csDVector4 Class Reference
[Geometry utilities]
A 4D vector with "double" components.
More...
#include <csgeom/vector4.h>
Public Member Functions | |
void | Cross (const csDVector4 &v1, const csDVector4 &v2) |
Take cross product of two vectors and put result in this vector. | |
csDVector4 (const csDVector3 &v) | |
Conversion from a three-component vector. w is set to 1. | |
csDVector4 (const csVector4 &) | |
Conversion from single precision vector to double. | |
csDVector4 (const csDVector4 &v) | |
Copy Constructor. | |
csDVector4 (double ix, double iy, double iz=0, double iw=1) | |
Make a new vector and initialize with the given values. | |
csDVector4 (double m) | |
Make a new initialized vector. | |
csDVector4 () | |
Make a new vector. | |
double | Norm () const |
Returns the norm of this vector. | |
void | Normalize () |
Scale this vector to length = 1.0. | |
csDVector4 & | operator *= (double f) |
Multiply this vector by a scalar. | |
csDVector4 | operator+ () const |
Unary + operator. | |
csDVector4 & | operator+= (const csDVector4 &v) |
Add another vector to this vector. | |
csDVector4 | operator- () const |
Unary - operator. | |
csDVector4 & | operator-= (const csDVector4 &v) |
Subtract another vector from this vector. | |
csDVector4 & | operator/= (double f) |
Divide this vector by a scalar. | |
double & | operator[] (int n) |
Returns n'th component of the vector. | |
double | operator[] (int n) const |
Returns n'th component of the vector. | |
void | Set (double sx, double sy, double sz, double sw) |
Set the value of this vector. | |
double | SquaredNorm () const |
Returns the norm of this vector. | |
csDVector4 | Unit () const |
Returns the unit vector in the direction of this vector. | |
Static Public Member Functions | |
static double | Norm (const csDVector4 &v) |
Returns the norm (magnitude) of a vector. | |
static csDVector4 | Unit (const csDVector4 &v) |
Normalizes a vector to a unit vector. | |
Public Attributes | |
double | w |
The W component of the vector. | |
double | x |
The X component of the vector. | |
double | y |
The Y component of the vector. | |
double | z |
The Z component of the vector. | |
Friends | |
csDVector4 | operator * (double f, const csDVector4 &v) |
Multiply a vector and a scalar. | |
csDVector4 | operator * (const csDVector4 &v, double f) |
Multiply a vector and a scalar. | |
double | operator * (const csDVector4 &v1, const csDVector4 &v2) |
Take the dot product of two vectors. | |
bool | operator!= (const csDVector4 &v1, const csDVector4 &v2) |
Check if two vectors are not equal. | |
csDVector4 | operator% (const csDVector4 &v1, const csDVector4 &v2) |
Take the cross product of two vectors. | |
csDVector4 | operator+ (const csDVector4 &v1, const csDVector4 &v2) |
Add two vectors. | |
csDVector4 | operator- (const csDVector4 &v1, const csDVector4 &v2) |
Subtract two vectors. | |
csDVector4 | operator/ (const csDVector4 &v, double f) |
Divide a vector by a scalar. | |
bool | operator< (const csDVector4 &v, double f) |
Test if each component of a vector is less than a small epsilon value. | |
csDVector4 | operator<< (const csDVector4 &v1, const csDVector4 &v2) |
Project one vector onto another. | |
bool | operator== (const csDVector4 &v1, const csDVector4 &v2) |
Check if two vectors are equal. | |
bool | operator> (double f, const csDVector4 &v) |
Test if each component of a vector is greater than a small epsilon value. | |
csDVector4 | operator>> (const csDVector4 &v1, const csDVector4 &v2) |
Project one vector onto another. |
Detailed Description
A 4D vector with "double" components.
Definition at line 40 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 csDVector4(0) |
|
Make a new vector and initialize with the given values.
|
|
Copy Constructor.
|
|
Conversion from single precision vector to double.
|
|
Conversion from a three-component vector. w is set to 1.
Definition at line 76 of file vector4.h. References csDVector3::x, csDVector3::y, and csDVector3::z. |
Member Function Documentation
|
Take cross product of two vectors and put result in this vector.
|
|
Returns the norm (magnitude) of a vector.
Definition at line 213 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.
|
|
Returns the norm of this vector.
|
|
Normalizes a vector to a unit vector.
Definition at line 216 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 210 of file vector4.h. Referenced by Unit(). |
Friends And Related Function Documentation
|
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.
|
|
Subtract two vectors.
|
|
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 greater than a small epsilon value.
|
|
Project one vector onto another.
|
Member Data Documentation
|
The W component of the vector.
Definition at line 50 of file vector4.h. Referenced by Cross(), csDVector4(), operator+=(), and operator-=(). |
|
The X component of the vector.
Definition at line 44 of file vector4.h. Referenced by Cross(), csDVector4(), operator+=(), and operator-=(). |
|
The Y component of the vector.
Definition at line 46 of file vector4.h. Referenced by Cross(), csDVector4(), operator+=(), and operator-=(). |
|
The Z component of the vector.
Definition at line 48 of file vector4.h. Referenced by Cross(), csDVector4(), operator+=(), and operator-=(). |
The documentation for this class was generated from the following file:
- csgeom/vector4.h
Generated for Crystal Space by doxygen 1.4.4