#include <Vector2C.h>
Public Methods | |
Vector2C (float32 f32X=0, float32 f32Y=0) | |
Default constructor. | |
Vector2C (const Vector2C &rVec) | |
Copy constructor. | |
Vector2C (const float32 f32A[2]) | |
Creates a new vector with the values as the array pointed by the argument. | |
virtual | ~Vector2C () |
Default destructor. | |
float32 & | operator[] (int32 i) |
Return reference to the component pointed by the index. | |
const float32 & | operator[] (int32 i) const |
Return reference to the component pointed by the index. | |
Vector2C | operator- () const |
Returns Negated vector. | |
bool | operator== (const Vector2C &rVec) const |
Return true if both vectors are equal, else false. | |
bool | operator!= (const Vector2C &rVec) const |
Return true if both vectors are not equal, else false. | |
Vector2C & | operator-= (const Vector2C &rVec) |
Substracts the vector specified by argument from the vector and stores the result. | |
Vector2C & | operator+= (const Vector2C &rVec) |
Adds the vector specified by argument from the vector and stores the result. | |
Vector2C & | operator *= (float32 f32S) |
Multiplies the vector by a scalar value specified by the argument and stores the result. | |
Vector2C & | operator/= (float32 f32S) |
Divides the vector by a scalar value specified by the argument and stores the result. | |
Vector2C | operator * (float32 f32S) const |
Multiplies the vector by a scalar value specified by the argument and returns the result. | |
Vector2C | operator/ (float32 f32S) const |
Divides the vector by a scalar value specified by the argument and returns the result. | |
Vector2C | operator- (const Vector2C &rVec) const |
Substracts the vector specified by argument from the vector and returns the result. | |
Vector2C | operator+ (const Vector2C &rVec) const |
Adds the vector specified by argument from the vector and returns the result. | |
Vector2C | operator * (const Vector2C &rVec) const |
Multiplies the vector specified by argument from the vector and returns the result. | |
Vector2C | normalize () const |
Normalizes the vector to unit size and returns the result. | |
float32 | length () const |
Returns the length of the vector. | |
float32 | dot (const Vector2C &rVec) const |
Computes the dot product of the two vectors and returns the result. | |
Friends | |
Vector2C | operator * (float32 s, const Vector2C &rVec) |
Multiplies the vector by a scalar value specified by the argument and returns the result. |
Vector2C class defines a two dimensional vector class which is used by the Demopaja system. The vector class implements standard set of methods and overdriven opertators for easy use.
This class is implemented by the system.
|
Default constructor.
|
|
Copy constructor.
|
|
Creates a new vector with the values as the array pointed by the argument.
|
|
Default destructor.
|
|
Computes the dot product of the two vectors and returns the result.
|
|
Returns the length of the vector.
|
|
Normalizes the vector to unit size and returns the result.
|
|
Multiplies the vector specified by argument from the vector and returns the result. The multiplication is done component vise (that is, each corresponding component is multiplied). |
|
Multiplies the vector by a scalar value specified by the argument and returns the result.
|
|
Multiplies the vector by a scalar value specified by the argument and stores the result.
|
|
Return true if both vectors are not equal, else false.
|
|
Adds the vector specified by argument from the vector and returns the result.
|
|
Adds the vector specified by argument from the vector and stores the result.
|
|
Substracts the vector specified by argument from the vector and returns the result.
|
|
Returns Negated vector.
|
|
Substracts the vector specified by argument from the vector and stores the result.
|
|
Divides the vector by a scalar value specified by the argument and returns the result.
|
|
Divides the vector by a scalar value specified by the argument and stores the result.
|
|
Return true if both vectors are equal, else false.
|
|
Return reference to the component pointed by the index. The index values from 0 to 1 corresponds to components X, and Y respectively. There are two versions of this method, this version is for retrieving the values. |
|
Return reference to the component pointed by the index. The index values from 0 to 1 corresponds to components X, and Y respectively. There are two versions of this method, this version is to assign values. |
|
Multiplies the vector by a scalar value specified by the argument and returns the result.
|