|
Public Member Functions |
| Quaternion () |
| Default constructor. Initialises x, y, z and w to 0.
|
| Quaternion (float vx, float vy, float vz, float vw) |
| Constructor that initialises x, y, z and w from arguments.
|
| Quaternion (const Quaternion &q) |
| Copy constructor.
|
float | Magnitude () |
| Returns the magnitude of a quaternion. Primarily used for normalization.
|
void | Normalize () |
| Normalises a given quaternion. Sets its Magnitude to 1.
|
std::string | ToString () |
| Returns a string that represents the actual object.
|
float & | operator[] (unsigned int i) |
| Array indexing operator.
|
const float & | operator[] (unsigned int i) const |
| Array indexing operator.
|
Quaternion & | operator+= (const Quaternion &q) |
| Adds a Quaternion to this one.
|
Quaternion & | operator-= (const Quaternion &q) |
| Subtracts a Quaternion from this one.
|
Quaternion & | operator *= (float f) |
| Multiplies the Quaternion by a float.
|
Quaternion & | operator/= (float f) |
| Divides the Quaternion by a float.
|
Public Attributes |
float | x |
float | y |
float | z |
float | w |
Friends |
bool | operator== (const Quaternion &q1, const Quaternion &q2) |
| Are these two Quaternions equal ?
|
bool | operator!= (const Quaternion &q1, const Quaternion &q2) |
| Are these two Quaternions not equal ?
|
Quaternion | operator- (const Quaternion &q) |
| Gets the conjugate of this Quaternion.
|
Quaternion | operator+ (const Quaternion &q1, const Quaternion &q2) |
| Adds two Quaternions.
|
Quaternion | operator- (const Quaternion &q1, const Quaternion &q2) |
| Subtracts one Quaternion from another.
|
Quaternion | operator * (const Quaternion &q, float f) |
| Multiplies a Quaternion by a float.
|
Quaternion | operator * (float f, const Quaternion &q) |
| Multiplies a Quaternion by a float.
|
Quaternion | operator/ (const Quaternion &q, float f) |
| Divides a Quaternion by a float.
|
Quaternion | operator * (const Quaternion &q1, const Quaternion &q2) |
| Multiplies 2 Quaternions.
|
Quaternion | operator/ (const Quaternion &q1, const Quaternion &q2) |
| Divides 2 Quaternions.
|