![]() |
Beaming Scene Service
2.0
RakNet wrapper for managing data communications between multiple Beaming clients
|
math helper class for quaternions More...
#include <utilMath.h>
Public Member Functions | |
CQuat () | |
CQuat (float fx, float fy, float fz, float fw) | |
CQuat (float Angle, const CVec3 &Axis) | |
void | Reset () |
No rotation. | |
int | IsIdentity () const |
True if identity (x == 0.0f && y == 0.0f && z == 0.0f && w==1.0f) | |
void | SetAxis (float degrees, float fX, float fY, float fZ) |
Set Quat from axis-angle. | |
void | FromEuler (float rx, float ry, float rz) |
Simple Euler Angle to Quaternion conversion (this could be made faster) | |
void | ToMatrix (float mf[16]) const |
Set a 4x4 matrix with the rotation of this Quaternion. | |
CQuat | Invert () const |
Invert. | |
bool | operator== (const CQuat &b) const |
(You could add an epsilon to this equality test if needed) | |
CQuat | operator+ (const CQuat &b) const |
Addition. | |
CQuat | operator* (const CQuat &b) const |
Concatenate quaternions. (Note that order matters with concatenating Quaternion rotations) | |
CVec3 | operator* (const CVec3 &v) const |
Apply rotation to vector. | |
CQuat | operator* (float s) const |
Scalar multiplication. | |
float | Dot (const CQuat &a) const |
Can be used the determine Quaternion neighbourhood. | |
int | Normalize () |
Quaternions store scale as well as rotation, but usually we just want rotation, so we can normalize. | |
void | Slerp (const CQuat &a, const CQuat &b, float t) |
void | NLerp (const CQuat &a, const CQuat &b, float w2) |
void | AimZAxis (const CVec3 &P1, const CVec3 &P2) |
Set this Quat to aim the Z-Axis along the vector from P1 to P2. | |
Public Attributes | |
float | x |
float | y |
float | z |
float | w |
math helper class for quaternions
Definition at line 160 of file utilMath.h.
CQuat::CQuat | ( | ) | [inline] |
Definition at line 165 of file utilMath.h.
CQuat::CQuat | ( | float | fx, |
float | fy, | ||
float | fz, | ||
float | fw | ||
) | [inline] |
Definition at line 169 of file utilMath.h.
CQuat::CQuat | ( | float | Angle, |
const CVec3 & | Axis | ||
) | [inline] |
Definition at line 175 of file utilMath.h.
void CQuat::AimZAxis | ( | const CVec3 & | P1, |
const CVec3 & | P2 | ||
) | [inline] |
Set this Quat to aim the Z-Axis along the vector from P1 to P2.
Definition at line 382 of file utilMath.h.
float CQuat::Dot | ( | const CQuat & | a | ) | const [inline] |
Can be used the determine Quaternion neighbourhood.
Definition at line 313 of file utilMath.h.
void CQuat::FromEuler | ( | float | rx, |
float | ry, | ||
float | rz | ||
) | [inline] |
Simple Euler Angle to Quaternion conversion (this could be made faster)
Definition at line 207 of file utilMath.h.
CQuat CQuat::Invert | ( | ) | const [inline] |
Invert.
Definition at line 250 of file utilMath.h.
int CQuat::IsIdentity | ( | ) | const [inline] |
True if identity (x == 0.0f && y == 0.0f && z == 0.0f && w==1.0f)
Definition at line 189 of file utilMath.h.
void CQuat::NLerp | ( | const CQuat & | a, |
const CQuat & | b, | ||
float | w2 | ||
) | [inline] |
linearly interpolate each component, then normalize the Quaternion Unlike spherical interpolation, this does not rotate at a constant velocity, although that's not necessarily a bad thing
Definition at line 370 of file utilMath.h.
int CQuat::Normalize | ( | ) | [inline] |
Quaternions store scale as well as rotation, but usually we just want rotation, so we can normalize.
Definition at line 321 of file utilMath.h.
Concatenate quaternions. (Note that order matters with concatenating Quaternion rotations)
Definition at line 268 of file utilMath.h.
Apply rotation to vector.
Definition at line 281 of file utilMath.h.
CQuat CQuat::operator* | ( | float | s | ) | const [inline] |
Scalar multiplication.
Definition at line 306 of file utilMath.h.
Addition.
Definition at line 262 of file utilMath.h.
bool CQuat::operator== | ( | const CQuat & | b | ) | const [inline] |
(You could add an epsilon to this equality test if needed)
Definition at line 256 of file utilMath.h.
void CQuat::Reset | ( | ) | [inline] |
No rotation.
Definition at line 181 of file utilMath.h.
void CQuat::SetAxis | ( | float | degrees, |
float | fX, | ||
float | fY, | ||
float | fZ | ||
) | [inline] |
Set Quat from axis-angle.
Definition at line 195 of file utilMath.h.
void CQuat::Slerp | ( | const CQuat & | a, |
const CQuat & | b, | ||
float | t | ||
) | [inline] |
Creates a value for this Quaternion from spherical linear interpolation t is the interpolation value from 0 to 1
Definition at line 342 of file utilMath.h.
void CQuat::ToMatrix | ( | float | mf[16] | ) | const [inline] |
Set a 4x4 matrix with the rotation of this Quaternion.
Definition at line 218 of file utilMath.h.
float CQuat::w |
Definition at line 163 of file utilMath.h.
float CQuat::x |
Definition at line 163 of file utilMath.h.
float CQuat::y |
Definition at line 163 of file utilMath.h.
float CQuat::z |
Definition at line 163 of file utilMath.h.