|
Public Member Functions |
| Vector3 () |
| The default constructor creates a zero vector.
|
| Vector3 (const real x, const real y, const real z) |
| The explicit constructor creates a vector with the given components.VectorIntro.
|
real | operator[] (unsigned i) const |
| <Omit;Vector
|
real & | operator[] (unsigned i) |
void | operator+= (const Vector3 &v) |
| Adds the given vector to this.
|
Vector3 | operator+ (const Vector3 &v) const |
| Returns the value of the given vector added to this.VectorAddition.
|
void | operator-= (const Vector3 &v) |
| Subtracts the given vector from this.
|
Vector3 | operator- (const Vector3 &v) const |
| Returns the value of the given vector subtracted from this.VectorSubtraction.
|
void | operator *= (const real value) |
| Multiplies this vector by the given scalar.
|
Vector3 | operator * (const real value) const |
| Returns a copy of this vector scaled the given value.ScalarMultiply.
|
Vector3 | componentProduct (const Vector3 &vector) const |
| Calculates and returns a component-wise product of this vector with the given vector.
|
void | componentProductUpdate (const Vector3 &vector) |
| Performs a component-wise product with the given vector and sets this vector to its result.ComponentProduct.
|
Vector3 | vectorProduct (const Vector3 &vector) const |
| Calculates and returns the vector product of this vector with the given vector.
|
void | operator%= (const Vector3 &vector) |
| Updates this vector to be the vector product of its current value and the given vector.
|
Vector3 | operator% (const Vector3 &vector) const |
| Calculates and returns the vector product of this vector with the given vector.VectorProduct.
|
real | scalarProduct (const Vector3 &vector) const |
| Calculates and returns the scalar product of this vector with the given vector.
|
real | operator * (const Vector3 &vector) const |
| Calculates and returns the scalar product of this vector with the given vector.ScalarProduct.
|
void | addScaledVector (const Vector3 &vector, real scale) |
| Adds the given vector to this, scaled by the given amount.ScaledVectorAddition.
|
real | magnitude () const |
| Gets the magnitude of this vector.
|
real | squareMagnitude () const |
| Gets the squared magnitude of this vector.
|
void | normalise () |
| Turns a non-zero vector into a vector of unit length.Normalise.
|
bool | operator== (const Vector3 &other) const |
| Checks if the two vectors have identical components.
|
bool | operator!= (const Vector3 &other) const |
| Checks if the two vectors have non-identical components.
|
bool | operator< (const Vector3 &other) const |
| Checks if this vector is component-by-component less than the other.
|
bool | operator> (const Vector3 &other) const |
| Checks if this vector is component-by-component less than the other.
|
bool | operator<= (const Vector3 &other) const |
| Checks if this vector is component-by-component less than the other.
|
bool | operator>= (const Vector3 &other) const |
| Checks if this vector is component-by-component less than the other.
|
void | clear () |
| Zero all the components of the vector.
|
void | invert () |
| Flips all the components of the vector.
|
Public Attributes |
real | x |
| Holds the value along the x axis.
|
real | y |
| Holds the value along the y axis.
|
real | z |
| Holds the value along the z axis.
|
Static Public Attributes |
static const Vector3 | GRAVITY |
static const Vector3 | HIGH_GRAVITY |
static const Vector3 | UP |
static const Vector3 | RIGHT |
static const Vector3 | OUT |
static const Vector3 | X |
static const Vector3 | Y |
static const Vector3 | Z |
Four data members are allocated to ensure alignment in an array. /<VectorIntro