#include <Vector.h>
Collaboration diagram for Vector< T >:
Public Member Functions | |
Vector (T x=0, T y=0, T z=0) | |
T | x () const |
T | y () const |
T | z () const |
void | setX (T x) |
void | setY (T y) |
void | setZ (T z) |
T * | vector () |
const T * | vector () const |
operator T * () | |
Vector< T > | operator+= (const Vector< T > &v) |
Vector< T > | operator+ (const Vector< T > &v) const |
Vector< T > | operator-= (const Vector< T > &v) |
Vector< T > | operator- (const Vector< T > &v) const |
Vector< T > | operator- () const |
Vector< T > | operator *= (const Vector< T > &b) |
Vector< T > | operator * (const Vector< T > &b) const |
T | dotProduct (const Vector< T > &b) const |
Vector< T > & | operator *= (T scalar) |
Vector< T > & | operator+= (T scalar) |
Vector< T > | operator * (T scalar) const |
Vector< T > & | operator/= (float scalar) |
Vector< T > | operator/ (float scalar) const |
bool | operator== (const Vector< T > &v2) const |
float | len () const |
Vector< T > | normalized () const |
Vector< T > & | normalize () |
float | angle (const Vector< T > &with) const |
Calculates the angle between this vector and with. | |
bool | operator>= (const Vector< T > &b) const |
bool | operator<= (const Vector< T > &b) const |
bool | operator< (const Vector< T > &b) const |
bool | operator> (const Vector< T > &b) const |
Private Attributes | |
T | mCoords [3] |
This can also be used to represent points. Various functions are provided; vectors generally behave like you would expect.
|
|
|
Calculates the angle between this vector and with. The angle is determined by: |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|