#include <Vector2.h>
Public Member Functions | |
Vector2 (Real fX, Real fY) | |
Vector2 (Real afCoordinate[2]) | |
Vector2 (int afCoordinate[2]) | |
Vector2 (const Real *const r) | |
Vector2 (const Vector2 &rkVector) | |
Real | operator[] (size_t i) const |
Real & | operator[] (size_t i) |
Vector2 & | operator= (const Vector2 &rkVector) |
Assigns the value of the other vector. | |
bool | operator== (const Vector2 &rkVector) const |
bool | operator!= (const Vector2 &rkVector) const |
Vector2 | operator+ (const Vector2 &rkVector) const |
Vector2 | operator- (const Vector2 &rkVector) const |
Vector2 | operator * (Real fScalar) const |
Vector2 | operator * (const Vector2 &rhs) const |
Vector2 | operator/ (Real fScalar) const |
Vector2 | operator- () const |
Vector2 & | operator+= (const Vector2 &rkVector) |
Vector2 & | operator-= (const Vector2 &rkVector) |
Vector2 & | operator *= (Real fScalar) |
Vector2 & | operator/= (Real fScalar) |
Real | length () const |
Returns the length (magnitude) of the vector. | |
Real | squaredLength () const |
Returns the square of the length(magnitude) of the vector. | |
Real | dotProduct (const Vector2 &vec) const |
Calculates the dot (scalar) product of this vector with another. | |
Real | normalise () |
Normalises the vector. | |
Vector2 | midPoint (const Vector2 &vec) const |
Returns a vector at a point half way between this and the passed in vector. | |
bool | operator< (const Vector2 &rhs) const |
Returns true if the vector's scalar components are all greater that the ones of the vector it is compared against. | |
bool | operator> (const Vector2 &rhs) const |
Returns true if the vector's scalar components are all smaller that the ones of the vector it is compared against. | |
void | makeFloor (const Vector2 &cmp) |
Sets this vector's components to the minimum of its own and the ones of the passed in vector. | |
void | makeCeil (const Vector2 &cmp) |
Sets this vector's components to the maximum of its own and the ones of the passed in vector. | |
Vector2 | perpendicular (void) const |
Generates a vector perpendicular to this vector (eg an 'up' vector). | |
Vector2 | crossProduct (const Vector2 &rkVector) const |
Calculates the cross-product of 2 vectors, i.e. | |
Vector2 | randomDeviant (Real angle) const |
Generates a new random vector which deviates from this vector by a given angle in a random direction. | |
bool | isZeroLength (void) const |
Returns true if this vector is zero length. | |
Vector2 | normalisedCopy (void) const |
As normalise, except that this vector is unaffected and the normalised vector is returned as a copy. | |
Vector2 | reflect (const Vector2 &normal) |
Calculates a reflection vector to the plane with the given normal . | |
Static Public Attributes | |
static const Vector2 | ZERO |
static const Vector2 | UNIT_X |
static const Vector2 | UNIT_Y |
static const Vector2 | NEGATIVE_UNIT_X |
static const Vector2 | NEGATIVE_UNIT_Y |
static const Vector2 | UNIT_SCALE |
Friends | |
Vector2 | operator * (Real fScalar, const Vector2 &rkVector) |
|
Calculates the cross-product of 2 vectors, i.e. the vector that lies perpendicular to them both.
|
|
Calculates the dot (scalar) product of this vector with another.
|
|
Returns the length (magnitude) of the vector.
|
|
Sets this vector's components to the maximum of its own and the ones of the passed in vector.
|
|
Sets this vector's components to the minimum of its own and the ones of the passed in vector.
|
|
Normalises the vector.
|
|
Assigns the value of the other vector.
|
|
Generates a vector perpendicular to this vector (eg an 'up' vector).
|
|
Generates a new random vector which deviates from this vector by a given angle in a random direction.
|
|
Calculates a reflection vector to the plane with the given normal .
|
|
Returns the square of the length(magnitude) of the vector.
|