csDVector3 Class Reference
[Geometry utilities]
A 3D vector.
More...
#include <csgeom/math3d_d.h>
Public Member Functions | |
void | Cross (const csDVector3 &px, const csDVector3 &py) |
Take cross product of two vectors and put result in this vector. | |
csDVector3 (const csVector3 &) | |
Conversion from single precision vector to double. | |
csDVector3 (const csDVector3 &v) | |
Copy Constructor. | |
csDVector3 (double ix, double iy, double iz=0) | |
Make a new vector and initialize with the given values. | |
csDVector3 (double m) | |
Make a new initialized vector. | |
csDVector3 () | |
Make a new vector. | |
double | Norm () const |
Returns the norm of this vector. | |
void | Normalize () |
Scale this vector to length = 1.0. | |
csDVector3 & | operator *= (double f) |
Multiply this vector by a scalar. | |
csDVector3 | operator+ () const |
Unary + operator. | |
csDVector3 & | operator+= (const csDVector3 &v) |
Add another vector to this vector. | |
csDVector3 | operator- () const |
Unary - operator. | |
csDVector3 & | operator-= (const csDVector3 &v) |
Subtract another vector from this vector. | |
csDVector3 & | 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) |
Set the value of this vector. | |
double | SquaredNorm () const |
Returns the norm of this vector. | |
csDVector3 | Unit () const |
Returns the unit vector in the direction of this vector. | |
Static Public Member Functions | |
static double | Norm (const csDVector3 &v) |
Returns the norm (magnitude) of a vector. | |
static csDVector3 | Unit (const csDVector3 &v) |
Normalizes a vector to a unit vector. | |
Public Attributes | |
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 | |
csDVector3 | operator * (double f, const csDVector3 &v) |
Multiply a vector and a scalar. | |
csDVector3 | operator * (const csDVector3 &v, double f) |
Multiply a vector and a scalar. | |
double | operator * (const csDVector3 &v1, const csDVector3 &v2) |
Take the dot product of two vectors. | |
bool | operator!= (const csDVector3 &v1, const csDVector3 &v2) |
Check if two vectors are not equal. | |
csDVector3 | operator% (const csDVector3 &v1, const csDVector3 &v2) |
Take the cross product of two vectors. | |
csDVector3 | operator+ (const csDVector3 &v1, const csDVector3 &v2) |
Add two vectors. | |
csDVector3 | operator- (const csDVector3 &v1, const csDVector3 &v2) |
Subtract two vectors. | |
csDVector3 | operator/ (const csDVector3 &v, double f) |
Divide a vector by a scalar. | |
bool | operator< (const csDVector3 &v, double f) |
Test if each component of a vector is less than a small epsilon value. | |
csDVector3 | operator<< (const csDVector3 &v1, const csDVector3 &v2) |
Project one vector onto another. | |
bool | operator== (const csDVector3 &v1, const csDVector3 &v2) |
Check if two vectors are equal. | |
bool | operator> (double f, const csDVector3 &v) |
Test if each component of a vector is greater than a small epsilon value. | |
csDVector3 | operator>> (const csDVector3 &v1, const csDVector3 &v2) |
Project one vector onto another. |
Detailed Description
A 3D vector.
Definition at line 50 of file math3d_d.h.
Constructor & Destructor Documentation
|
Make a new vector. The vector is not initialized. This makes the code slightly faster as csDVector3 objects are used a lot. Definition at line 65 of file math3d_d.h. |
|
Make a new initialized vector. Creates a new vector and initializes it to m*<1,1,1>. To create a vector initialized to the zero vector, use csDVector3(0) Definition at line 72 of file math3d_d.h. |
|
Make a new vector and initialize with the given values.
Definition at line 75 of file math3d_d.h. |
|
Copy Constructor.
Definition at line 78 of file math3d_d.h. |
|
Conversion from single precision vector to double.
|
Member Function Documentation
|
Take cross product of two vectors and put result in this vector.
Definition at line 107 of file math3d_d.h. |
|
Returns the norm (magnitude) of a vector.
Definition at line 209 of file math3d_d.h. References Norm(). |
|
Returns the norm of this vector.
Referenced by csDMath3::DoubleArea3(), and Norm(). |
|
Scale this vector to length = 1.0.
|
|
Multiply this vector by a scalar.
Definition at line 179 of file math3d_d.h. |
|
Unary + operator.
Definition at line 187 of file math3d_d.h. |
|
Add another vector to this vector.
Definition at line 159 of file math3d_d.h. |
|
Unary - operator.
Definition at line 190 of file math3d_d.h. |
|
Subtract another vector from this vector.
Definition at line 169 of file math3d_d.h. |
|
Divide this vector by a scalar.
Definition at line 183 of file math3d_d.h. |
|
Returns n-th component of the vector.
Definition at line 156 of file math3d_d.h. |
|
Returns n-th component of the vector.
Definition at line 153 of file math3d_d.h. |
|
Set the value of this vector.
Definition at line 193 of file math3d_d.h. |
|
Returns the norm of this vector.
|
|
Normalizes a vector to a unit vector.
Definition at line 212 of file math3d_d.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 206 of file math3d_d.h. Referenced by Unit(). |
Friends And Related Function Documentation
|
Multiply a vector and a scalar.
Definition at line 119 of file math3d_d.h. |
|
Multiply a vector and a scalar.
Definition at line 115 of file math3d_d.h. |
|
Take the dot product of two vectors.
Definition at line 94 of file math3d_d.h. |
|
Check if two vectors are not equal.
Definition at line 131 of file math3d_d.h. |
|
Take the cross product of two vectors.
Definition at line 99 of file math3d_d.h. |
|
Add two vectors.
Definition at line 85 of file math3d_d.h. |
|
Subtract two vectors.
Definition at line 90 of file math3d_d.h. |
|
Divide a vector by a scalar.
Definition at line 123 of file math3d_d.h. |
|
Test if each component of a vector is less than a small epsilon value.
Definition at line 145 of file math3d_d.h. |
|
Project one vector onto another.
Definition at line 141 of file math3d_d.h. |
|
Check if two vectors are equal.
Definition at line 127 of file math3d_d.h. |
|
Test if each component of a vector is greater than a small epsilon value.
Definition at line 149 of file math3d_d.h. |
|
Project one vector onto another.
Definition at line 136 of file math3d_d.h. |
Member Data Documentation
|
The X component of the vector.
Definition at line 54 of file math3d_d.h. Referenced by csDPlane::Classify(), Cross(), csDVector3(), csDVector4::csDVector4(), operator+=(), operator-=(), csDSquaredDist::PointPoint(), csDMath3::SetMinMax(), and csDMath3::WhichSide3D(). |
|
The Y component of the vector.
Definition at line 56 of file math3d_d.h. Referenced by csDPlane::Classify(), Cross(), csDVector3(), csDVector4::csDVector4(), operator+=(), operator-=(), csDSquaredDist::PointPoint(), csDMath3::SetMinMax(), and csDMath3::WhichSide3D(). |
|
The Z component of the vector.
Definition at line 58 of file math3d_d.h. Referenced by csDPlane::Classify(), Cross(), csDVector3(), csDVector4::csDVector4(), operator+=(), operator-=(), csDSquaredDist::PointPoint(), csDMath3::SetMinMax(), and csDMath3::WhichSide3D(). |
The documentation for this class was generated from the following file:
- csgeom/math3d_d.h
Generated for Crystal Space by doxygen 1.4.4