Public Member Functions |
|
|
|
| CS123Vector (const T *srcData) |
| | Expects N arguments of type T.
|
|
| CS123Vector () |
| | Constructs a zero Vector.
|
|
| CS123Vector (const CS123Vector< N, T > &v) |
| | Copy Constructor.
|
|
|
| const T & | operator[] (const unsigned index) const |
| T & | operator[] (const unsigned index) |
| const T * | operator* () const |
| T * | operator* () |
|
|
|
bool | operator== (const CS123Vector< N, T > &v) const |
|
bool | operator!= (const CS123Vector< N, T > &v) const |
|
|
|
CS123Vector< N, T > & | operator= (const CS123Vector< N, T > &v) |
|
CS123Vector< N, T > & | operator+= (const CS123Vector< N, T > &rhs) |
|
CS123Vector< N, T > & | operator-= (const CS123Vector< N, T > &rhs) |
|
|
|
CS123Vector< N, T > & | operator*= (const T &scale) |
|
CS123Vector< N, T > & | operator/= (const T &scale) |
|
|
|
CS123Vector< N, T > | operator+ (const CS123Vector< N, T > &rhs) const |
|
CS123Vector< N, T > | operator- (const CS123Vector< N, T > &rhs) const |
|
|
|
CS123Vector< N, T > | operator* (const T &scale) const |
|
CS123Vector< N, T > | operator/ (const T &scale) const |
|
|
| bool | isUnit () const |
| bool | isZero () const |
| CS123Vector< N, T > | getNormalized () const |
|
T | normalize () |
| | Normalizes this Vector and returns the old magnitude.
|
| T | getMagnitude () const |
| T | getMagnitude2 () const |
| T | getDistance (const CS123Vector< N, T > &v) const |
| T | getDistance2 (const CS123Vector< N, T > &v) const |
| T | getSum () const |
| T | getAverage () const |
| T | dot (const CS123Vector< N, T > &rhs) const |
|
void | cleanup () |
| | Cleans up vector (0's out entries that are less than epsilon).
|
|
|
|
| CS123Vector (const T &v0, const T &v1=0, const T &v2=0, const T &v3=0) |
| | Convenience Constructor.
|
| CS123Vector< N, T > | cross (const CS123Vector< N, T > &rhs) const |
| CS123Vector< N, T > | reflectVector (const CS123Vector< N, T > &normal) const |
|
CS123Vector< N, T > | refractVector (const CS123Vector< N, T > &normal, REAL in, REAL out=1.0f) const |
Static Public Member Functions |
|
|
|
static CS123Vector< N, T > | zero () |
| | Generates a vector full of zeroes.
|
|
static CS123Vector< N, T > | ones () |
| | Generates a vector full of ones.
|
|
static CS123Vector< N, T > | fill (const T &val) |
| | Generates a vector filled with the specified value.
|
| static CS123Vector< N, T > | min (const CS123Vector< N, T > &v1, const CS123Vector< N, T > &v2) |
| static CS123Vector< N, T > | max (const CS123Vector< N, T > &v1, const CS123Vector< N, T > &v2) |
|
static CS123Vector< N, T > | infinity () |
| | Generates a vector filled with the maximum T (infinity).
|
|
static CS123Vector< N, T > | negativeInfinity () |
| | Generates a vector filled with the minimum T (negative infinity).
|
Public Attributes |
|
T | data [CS123_VECTOR_NO_ELEMENTS] |
| | Underlying data stored as an N-length array of type T.
|
Included in this definition are typedefs for the most commonly used vectors (Vector4, Vector3, etc), and these can be thought of as shortcuts to reference their associated CS123Vector templates. For example, Vector4 can be used to refer to CS123Vector<4, REAL>.