This class provides a wrapper for a geVec3D struct and provides an interface to Genesis3D vector manipulation functions. More...
Public Member Functions | |
void | Set (float x, float y, float z) |
Set the x, y and z components of the vector to the given values. | |
float | Dot (Vector v) |
Returns the dot product of this vector and vector v. | |
Vector | Cross (Vector v) |
Returns the vector cross product of this vector and v. | |
void | Normalize () |
Normalizes this vector in place. | |
bool | IsNormalized () |
Checks if this vector is normalized. | |
void | Scale (float scale) |
Scale the vector by scale. | |
void | Add (Vector v) |
Sets the value of this vector to the sum of itself and v. | |
void | Subtract (Vector v) |
Sets the value of this vector to the difference of itself and v. | |
void | Inverse () |
Negates the value of this vector in place. | |
float | DistanceTo (Vector v) |
Returns the distance between this point and v. | |
float | Length () |
Returns the Euclidean length of the vector. | |
float | LengthSquared () |
Returns the squared Euclidean length of the vector. |
Public Attributes | |
float | x |
vector x-axis value | |
float | y |
vector y-axis value | |
float | z |
vector z-axis value | |
float | length |
vector length |
This class provides a wrapper for a geVec3D struct and provides an interface to Genesis3D vector manipulation functions.
void Vector::Set | ( | float | x, |
float | y, | ||
float | z | ||
) |
Set the x, y and z components of the vector to the given values.
x | vector x-axis value |
y | vector y-axis value |
z | vector z-axis value |
float Vector::LengthSquared | ( | ) |
Returns the squared Euclidean length of the vector.
This is faster than Length() since the square root is not computed.