Public Member Functions |
void | Cross (const csVector3 &px, const csVector3 &py) |
| Take cross product of two vectors and put result in this vector.
|
| csVector3 (const csDVector3 &) |
| Conversion from double precision vector to single.
|
| csVector3 (const csVector3 &v) |
| Copy Constructor.
|
| csVector3 (float ix, float iy, float iz=0) |
| Make a new vector and initialize with the given values.
|
| csVector3 (float m) |
| Make a new initialized vector.
|
| csVector3 () |
| Make a new vector.
|
csString | Description () const |
| Return a textual representation of the vector in the form "x,y,z".
|
int | DominantAxis () const |
| Return index of the largest axis.
|
void | Get (float *v) const |
| Get the value of this vector.
|
float | InverseNorm () const |
| Returns the inverse norm (1/Norm()) 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;.
|
csVector3 & | operator*= (float f) |
| Multiply this vector by a scalar.
|
csVector3 | operator+ () const |
| Unary + operator.
|
csVector3 & | operator+= (const csVector3 &v) |
| Add another vector to this vector.
|
csVector3 | operator- () const |
| Unary - operator.
|
csVector3 & | operator-= (const csVector3 &v) |
| Subtract another vector from this vector.
|
csVector3 & | operator/= (float f) |
| Divide this vector by a scalar.
|
float & | operator[] (size_t n) |
| Returns n-th component of the vector.
|
float | operator[] (size_t 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 (csVector3 const &v) |
| Set the value of this vector.
|
void | Set (float sx, float sy, float sz) |
| Set the value of this vector.
|
float | SquaredNorm () const |
| Return the squared norm (magnitude) of this vector.
|
csVector3 | Unit () const |
| Returns the unit vector in the direction of this vector.
|
csVector3 | UnitAxisClamped () const |
| Return a version of the vector clamped to closest unit vector (+-xyz).
|
Static Public Member Functions |
static float | Norm (const csVector3 &v) |
| Returns the norm (magnitude) of a vector.
|
static csVector3 | Unit (const csVector3 &v) |
| Normalizes a vector to a unit vector.
|
Friends |
bool | operator!= (const csVector3 &v1, const csVector3 &v2) |
| Check if two vectors are not equal.
|
csVector3 | operator% (const csVector3 &v1, const csVector3 &v2) |
| Take the cross product of two vectors.
|
csVector3 | operator* (int f, const csVector3 &v) |
| Multiply a vector and a scalar int.
|
csVector3 | operator* (const csVector3 &v, int f) |
| Multiply a vector and a scalar int.
|
csDVector3 | operator* (double f, const csVector3 &v) |
| Multiply a vector and a scalar double. Upgrade v to DVector.
|
csDVector3 | operator* (const csVector3 &v, double f) |
| Multiply a vector and a scalar double. Upgrade v to DVector.
|
csVector3 | operator* (float f, const csVector3 &v) |
| Multiply a vector and a scalar.
|
csVector3 | operator* (const csVector3 &v, float f) |
| Multiply a vector and a scalar.
|
float | operator* (const csVector3 &v1, const csVector3 &v2) |
| Take the dot product of two vectors.
|
csDVector3 | operator+ (const csVector3 &v1, const csDVector3 &v2) |
| Add two vectors of differing type, raise the csVector3 to DVector3.
|
csDVector3 | operator+ (const csDVector3 &v1, const csVector3 &v2) |
| Add two vectors of differing type, raise the csVector3 to DVector3.
|
csVector3 | operator+ (const csVector3 &v1, const csVector3 &v2) |
| Add two vectors.
|
csDVector3 | operator- (const csDVector3 &v1, const csVector3 &v2) |
| Subtract two vectors of differing type, cast to double.
|
csDVector3 | operator- (const csVector3 &v1, const csDVector3 &v2) |
| Subtract two vectors of differing type, cast to double.
|
csVector3 | operator- (const csVector3 &v1, const csVector3 &v2) |
| Subtract two vectors.
|
csVector3 | operator/ (const csVector3 &v, int f) |
| Divide a vector by a scalar int.
|
csDVector3 | operator/ (const csVector3 &v, double f) |
| Divide a vector by a scalar double. Upgrade v to DVector.
|
csVector3 | operator/ (const csVector3 &v, float f) |
| Divide a vector by a scalar.
|
bool | operator< (const csVector3 &v, float f) |
| Test if each component of a vector is less than a small epsilon value.
|
csVector3 | operator<< (const csVector3 &v1, const csVector3 &v2) |
| Project one vector onto another.
|
bool | operator== (const csVector3 &v1, const csVector3 &v2) |
| Check if two vectors are equal.
|
bool | operator> (float f, const csVector3 &v) |
| Test if each component of a vector is greater than a small epsilon value.
|
csVector3 | operator>> (const csVector3 &v1, const csVector3 &v2) |
| Project one vector onto another.
|
A 3D vector.