csVector4 Class Reference
[Geometry utilities]
A 4D vector with "float" components.
More...
#include <csgeom/vector4.h>
Public Member Functions | |
void | Cross (const csVector4 &v1, const csVector4 &v2) |
Take cross product of two vectors and put result in this vector. | |
csVector4 (const csVector3 &v) | |
Convert from a three-component vector. w is set to 1. | |
csVector4 (const csDVector4 &v) | |
Copy from a double-vector. | |
csVector4 (const csVector4 &v) | |
Copy Constructor. | |
csVector4 (float ix, float iy, float iz=0, float iw=1) | |
Make a new vector and initialize with the given values. | |
csVector4 (float m) | |
Make a new initialized vector. | |
csVector4 () | |
Make a new vector. | |
csString | Description () const |
Return a textual representation of the vector in the form "x,y,z,w". | |
void | Get (float *v) |
Get the value of this vector. | |
bool | IsZero (float precision=SMALL_EPSILON) const |
Query if the vector is zero. | |
float | Norm () const |
Returns the norm of this vector. | |
void | Normalize () |
Scale this vector to length = 1.0;. | |
csVector4 & | operator *= (float f) |
Multiply this vector by a scalar. | |
csVector4 | operator+ () const |
Unary + operator. | |
csVector4 & | operator+= (const csVector4 &v) |
Add another vector to this vector. | |
csVector4 | operator- () const |
Unary - operator. | |
csVector4 & | operator-= (const csVector4 &v) |
Subtract another vector from this vector. | |
csVector4 & | operator/= (float f) |
Divide this vector by a scalar. | |
float & | operator[] (int n) |
Returns n-th component of the vector. | |
float | operator[] (int n) const |
Returns n-th component of the vector. | |
void | Set (float v) |
Set the value of this vector so that all components are the same. | |
void | Set (float const *v) |
Set the value of this vector. | |
void | Set (csVector4 const &v) |
Set the value of this vector. | |
void | Set (float sx, float sy, float sz, float sw) |
Set the value of this vector. | |
float | SquaredNorm () const |
Return the squared norm (magnitude) of this vector. | |
csVector4 | Unit () const |
Returns the unit vector in the direction of this vector. | |
Static Public Member Functions | |
static float | Norm (const csVector4 &v) |
Returns the norm (magnitude) of a vector. | |
static csVector4 | Unit (const csVector4 &v) |
Normalizes a vector to a unit vector. | |
Public Attributes | |
float | w |
The W component of the vector. | |
float | x |
The X component of the vector. | |
float | y |
The Y component of the vector. | |
float | z |
The Z component of the vector. | |
Friends | |
csVector4 | operator * (int f, const csVector4 &v) |
Multiply a vector and a scalar int. | |
csVector4 | operator * (const csVector4 &v, int f) |
Multiply a vector and a scalar int. | |
csDVector4 | operator * (double f, const csVector4 &v) |
Multiply a vector and a scalar double. Upgrade v to csDVector4. | |
csDVector4 | operator * (const csVector4 &v, double f) |
Multiply a vector and a scalar double. Upgrade v to csDVector4. | |
csVector4 | operator * (float f, const csVector4 &v) |
Multiply a vector and a scalar. | |
csVector4 | operator * (const csVector4 &v, float f) |
Multiply a vector and a scalar. | |
float | operator * (const csVector4 &v1, const csVector4 &v2) |
Take the dot product of two vectors. | |
bool | operator!= (const csVector4 &v1, const csVector4 &v2) |
Check if two vectors are not equal. | |
csVector4 | operator% (const csVector4 &v1, const csVector4 &v2) |
Take the cross product of two vectors. | |
csDVector4 | operator+ (const csVector4 &v1, const csDVector4 &v2) |
Add two vectors of differing type, raise the csVector4 to csDVector4. | |
csDVector4 | operator+ (const csDVector4 &v1, const csVector4 &v2) |
Add two vectors of differing type, raise the csVector4 to csDVector4. | |
csVector4 | operator+ (const csVector4 &v1, const csVector4 &v2) |
Add two vectors. | |
csDVector4 | operator- (const csDVector4 &v1, const csVector4 &v2) |
Subtract two vectors of differing type, raise the csVector4 to csDVector4. | |
csDVector4 | operator- (const csVector4 &v1, const csDVector4 &v2) |
Subtract two vectors of differing type, raise the csVector4 to csDVector4. | |
csVector4 | operator- (const csVector4 &v1, const csVector4 &v2) |
Subtract two vectors. | |
csVector4 | operator/ (const csVector4 &v, int f) |
Divide a vector by a scalar int. | |
csDVector4 | operator/ (const csVector4 &v, double f) |
Divide a vector by a scalar double. Upgrade v to csDVector4. | |
csVector4 | operator/ (const csVector4 &v, float f) |
Divide a vector by a scalar. | |
bool | operator< (const csVector4 &v, float f) |
Test if each component of a vector is less than a small epsilon value. | |
csVector4 | operator<< (const csVector4 &v1, const csVector4 &v2) |
Project one vector onto another. | |
bool | operator== (const csVector4 &v1, const csVector4 &v2) |
Check if two vectors are equal. | |
bool | operator> (float f, const csVector4 &v) |
Test if each component of a vector is less than a small epsilon value. | |
csVector4 | operator>> (const csVector4 &v1, const csVector4 &v2) |
Project one vector onto another. |
Detailed Description
A 4D vector with "float" components.
Definition at line 226 of file vector4.h.
Constructor & Destructor Documentation
|
Make a new vector. The vector is not initialized. This makes the code slightly faster. |
|
Make a new initialized vector. Creates a new vector and initializes it to m*<1,1,1,1>. To create a vector initialized to the zero vector, use csVector4(0) |
|
Make a new vector and initialize with the given values.
|
|
Copy Constructor.
|
|
Copy from a double-vector.
|
|
Convert from a three-component vector. w is set to 1.
|
Member Function Documentation
|
Take cross product of two vectors and put result in this vector.
|
|
Return a textual representation of the vector in the form "x,y,z,w".
|
|
Get the value of this vector.
|
|
Query if the vector is zero.
Definition at line 459 of file vector4.h. References ABS. |
|
Returns the norm (magnitude) of a vector.
Definition at line 450 of file vector4.h. References Norm(). |
|
Returns the norm of this vector.
Referenced by Norm(). |
|
Scale this vector to length = 1.0;.
|
|
Multiply this vector by a scalar.
|
|
Unary + operator.
|
|
Add another vector to this vector.
|
|
Unary - operator.
|
|
Subtract another vector from this vector.
|
|
Divide this vector by a scalar.
|
|
Returns n-th component of the vector.
|
|
Returns n-th component of the vector.
|
|
Set the value of this vector so that all components are the same.
|
|
Set the value of this vector.
|
|
Set the value of this vector.
|
|
Set the value of this vector.
|
|
Return the squared norm (magnitude) of this vector.
|
|
Normalizes a vector to a unit vector.
Definition at line 453 of file vector4.h. References Unit(). |
|
Returns the unit vector in the direction of this vector. Attempting to normalize a zero-vector will result in a divide by zero error. This is as it should be... fix the calling code. Definition at line 447 of file vector4.h. Referenced by Unit(). |
Friends And Related Function Documentation
|
Multiply a vector and a scalar int.
|
|
Multiply a vector and a scalar int.
|
|
Multiply a vector and a scalar double. Upgrade v to csDVector4.
|
|
Multiply a vector and a scalar double. Upgrade v to csDVector4.
|
|
Multiply a vector and a scalar.
|
|
Multiply a vector and a scalar.
|
|
Take the dot product of two vectors.
|
|
Check if two vectors are not equal.
|
|
Take the cross product of two vectors.
|
|
Add two vectors of differing type, raise the csVector4 to csDVector4.
|
|
Add two vectors of differing type, raise the csVector4 to csDVector4.
|
|
Add two vectors.
|
|
Subtract two vectors of differing type, raise the csVector4 to csDVector4.
|
|
Subtract two vectors of differing type, raise the csVector4 to csDVector4.
|
|
Subtract two vectors.
|
|
Divide a vector by a scalar int.
|
|
Divide a vector by a scalar double. Upgrade v to csDVector4.
|
|
Divide a vector by a scalar.
|
|
Test if each component of a vector is less than a small epsilon value.
|
|
Project one vector onto another.
|
|
Check if two vectors are equal.
|
|
Test if each component of a vector is less than a small epsilon value.
|
|
Project one vector onto another.
|
Member Data Documentation
|
The W component of the vector.
Definition at line 236 of file vector4.h. Referenced by Cross(), operator+=(), operator-=(), Set(), and csShaderVariable::SetValue(). |
|
The X component of the vector.
Definition at line 230 of file vector4.h. Referenced by Cross(), operator+=(), operator-=(), Set(), and csShaderVariable::SetValue(). |
|
The Y component of the vector.
Definition at line 232 of file vector4.h. Referenced by Cross(), operator+=(), operator-=(), Set(), and csShaderVariable::SetValue(). |
|
The Z component of the vector.
Definition at line 234 of file vector4.h. Referenced by Cross(), operator+=(), operator-=(), Set(), and csShaderVariable::SetValue(). |
The documentation for this class was generated from the following file:
- csgeom/vector4.h
Generated for Crystal Space by doxygen 1.4.4