"L. Spiro Engine"
|
A quaternion. More...
#include <LSMQuaternion.h>
Public Member Functions | |
LSE_INLINE LSE_CALLCTOR | CQuaternion (LSREAL _fX, LSREAL _fY, LSREAL _fZ, LSREAL _fW) |
LSE_INLINE LSE_CALLCTOR | CQuaternion (const CQuaternion &_qQuat) |
LSE_INLINE CQuaternion &LSE_FCALL | operator+= (const CQuaternion &_qQuat) |
LSE_INLINE CQuaternion &LSE_FCALL | operator-= (const CQuaternion &_qQuat) |
LSE_INLINE CQuaternion &LSE_FCALL | operator*= (const CQuaternion &_qQuat) |
LSE_INLINE CQuaternion &LSE_FCALL | operator*= (LSREAL _fVal) |
LSE_INLINE CQuaternion &LSE_FCALL | operator/= (LSREAL _fVal) |
LSE_INLINE CQuaternion LSE_FCALL | operator+ () const |
LSE_INLINE CQuaternion LSE_FCALL | operator- () const |
LSE_INLINE CQuaternion LSE_FCALL | operator+ (const CQuaternion &_qQuat) const |
LSE_INLINE CQuaternion LSE_FCALL | operator- (const CQuaternion &_qQuat) const |
LSE_INLINE CQuaternion LSE_FCALL | operator* (const CQuaternion &_qQuat) const |
LSE_INLINE CQuaternion LSE_FCALL | operator* (LSREAL _fVal) const |
LSE_INLINE CQuaternion LSE_FCALL | operator/ (LSREAL _fVal) const |
LSE_INLINE bool LSE_FCALL | operator== (const CQuaternion &_qQuat) const |
LSE_INLINE bool LSE_FCALL | operator!= (const CQuaternion &_qQuat) const |
LSE_INLINE LSREAL &LSE_FCALL | operator[] (LSUINT32 _ui32Index) |
LSE_INLINE LSREAL LSE_FCALL | operator[] (LSUINT32 _ui32Index) const |
LSE_INLINE CQuaternion &LSE_FCALL | Identity () |
LSE_INLINE CQuaternion LSE_FCALL | Conjugate () const |
LSE_INLINE LSREAL LSE_FCALL | Dot (const CQuaternion &_qQuat) const |
CQuaternion LSE_FCALL | Exp () const |
CQuaternion LSE_FCALL | Log () const |
LSE_INLINE LSREAL LSE_FCALL | LenSq () const |
LSE_INLINE LSREAL LSE_FCALL | Len () const |
LSE_INLINE LSVOID LSE_FCALL | Normalize () |
LSE_INLINE CQuaternion LSE_FCALL | Inverse () |
LSE_INLINE CQuaternion &LSE_FCALL | Lerp (const CQuaternion &_qLeft, const CQuaternion &_qRight, LSREAL _fT) |
CQuaternion &LSE_FCALL | Slerp (const CQuaternion &_qLeft, const CQuaternion &_qRight, LSREAL _fT) |
CQuaternion &LSE_FCALL | Squad (const CQuaternion &_qQ, const CQuaternion &_qA, const CQuaternion &_qB, const CQuaternion &_qC, LSREAL _fT) |
CQuaternion &LSE_FCALL | FromRotationMatrix (const CMatrix4x4 &_mMat) |
LSVOID LSE_FCALL | ToRotationMatrix (CMatrix4x4 &_mMat) const |
CQuaternion &LSE_FCALL | FromRotationVectors (const CVector3 _vVectors[3]) |
CQuaternion &LSE_FCALL | AddScaledVector (const CVector3 &_vVec, LSREAL _fTime) |
LSE_INLINE LSREAL &LSE_FCALL | X () |
LSE_INLINE LSREAL &LSE_FCALL | Y () |
LSE_INLINE LSREAL &LSE_FCALL | Z () |
LSE_INLINE LSREAL &LSE_FCALL | W () |
Public Attributes | |
struct { | |
LSREAL x | |
LSREAL y | |
LSREAL z | |
LSREAL w | |
} | u |
Static Protected Attributes | |
static LSUINT32 | m_ui32Next [3] |
A quaternion.
Class CQuaternion Description: Quaternion in XYZW format.
CQuaternion& LSE_FCALL lsm::CQuaternion::AddScaledVector | ( | const CVector3 & | _vVec, |
LSREAL | _fTime | ||
) |
Add a scaled vector.
_vVec | The vector to add after being scaled by _fTime. |
_fTime | The amount by which to scale _vVec before adding it to this queternion. |
LSE_INLINE CQuaternion LSE_FCALL lsm::CQuaternion::Conjugate | ( | ) | const |
Returns the conjugate of this quaternion.
LSE_INLINE LSREAL LSE_FCALL lsm::CQuaternion::Dot | ( | const CQuaternion & | _qQuat | ) | const |
Returns the dot product of this quaternion with another.
_qQuat | The operand. |
CQuaternion LSE_FCALL lsm::CQuaternion::Exp | ( | ) | const |
Returns the exponential of this quaternion.
CQuaternion& LSE_FCALL lsm::CQuaternion::FromRotationMatrix | ( | const CMatrix4x4 & | _mMat | ) |
Build from the rotation part of a 4-by-4 matrix. Matrix is row-major.
_mMat | The matrix from which to build this quaternion. |
CQuaternion& LSE_FCALL lsm::CQuaternion::FromRotationVectors | ( | const CVector3 | _vVectors[3] | ) |
Build from 3 vectors.
_vVectors | The right, up, and forward vectors to use for building of the quaternion. |
LSE_INLINE CQuaternion &LSE_FCALL lsm::CQuaternion::Identity | ( | ) |
Functions on self. Sets this quaternion to an identity quaternion and returns itself.
LSE_INLINE CQuaternion LSE_FCALL lsm::CQuaternion::Inverse | ( | ) |
Returns the inverse of this quaternion.
LSE_INLINE LSREAL LSE_FCALL lsm::CQuaternion::Len | ( | ) | const |
Returns the length of this quaternion.
LSE_INLINE LSREAL LSE_FCALL lsm::CQuaternion::LenSq | ( | ) | const |
Returns the squared length of this quaternion.
LSE_INLINE CQuaternion &LSE_FCALL lsm::CQuaternion::Lerp | ( | const CQuaternion & | _qLeft, |
const CQuaternion & | _qRight, | ||
LSREAL | _fT | ||
) |
Linear interpolation. Returns this object.
_qLeft | Starting point. |
_qRight | Ending point. |
_fT | Amount to interpolate between the starting and ending points. |
CQuaternion LSE_FCALL lsm::CQuaternion::Log | ( | ) | const |
Returns the natural log of this quaternion.
LSE_INLINE LSVOID LSE_FCALL lsm::CQuaternion::Normalize | ( | ) |
Normalizes this quaternion.
LSE_INLINE bool LSE_FCALL lsm::CQuaternion::operator!= | ( | const CQuaternion & | _qQuat | ) | const |
Inequality test.
_qQuat | Object against which to test for inequality. |
LSE_INLINE CQuaternion LSE_FCALL lsm::CQuaternion::operator* | ( | LSREAL | _fVal | ) | const |
Multiplication operator.
_fVal | The operand. |
LSE_INLINE CQuaternion LSE_FCALL lsm::CQuaternion::operator* | ( | const CQuaternion & | _qQuat | ) | const |
Multiplication operator.
_qQuat | The operand. |
LSE_INLINE CQuaternion &LSE_FCALL lsm::CQuaternion::operator*= | ( | const CQuaternion & | _qQuat | ) |
Muliplication assignment operator.
_qQuat | The quaternion to multiply by this quaternion. |
LSE_INLINE CQuaternion &LSE_FCALL lsm::CQuaternion::operator*= | ( | LSREAL | _fVal | ) |
Muliplication assignment operator on a per-component basis.
_fVal | The value by which to multiply each component in this quaternion. |
LSE_INLINE CQuaternion LSE_FCALL lsm::CQuaternion::operator+ | ( | const CQuaternion & | _qQuat | ) | const |
Addition operator.
_qQuat | The operand. |
LSE_INLINE CQuaternion LSE_FCALL lsm::CQuaternion::operator+ | ( | ) | const |
Unary +.
LSE_INLINE CQuaternion &LSE_FCALL lsm::CQuaternion::operator+= | ( | const CQuaternion & | _qQuat | ) |
Addition assignment operator.
_qQuat | The quaternion to add to this quaternion. |
LSE_INLINE CQuaternion LSE_FCALL lsm::CQuaternion::operator- | ( | const CQuaternion & | _qQuat | ) | const |
Subtraction operator.
_qQuat | The operand. |
LSE_INLINE CQuaternion LSE_FCALL lsm::CQuaternion::operator- | ( | ) | const |
Unary -.
LSE_INLINE CQuaternion &LSE_FCALL lsm::CQuaternion::operator-= | ( | const CQuaternion & | _qQuat | ) |
Subtraction assignment operator.
_qQuat | The quaternion to subtract from this quaternion. |
LSE_INLINE CQuaternion LSE_FCALL lsm::CQuaternion::operator/ | ( | LSREAL | _fVal | ) | const |
Division operator.
_fVal | The operand. |
LSE_INLINE CQuaternion &LSE_FCALL lsm::CQuaternion::operator/= | ( | LSREAL | _fVal | ) |
Division assignment operator on a per-component basis.
_fVal | The value by which to divide each component in this quaternion. |
LSE_INLINE bool LSE_FCALL lsm::CQuaternion::operator== | ( | const CQuaternion & | _qQuat | ) | const |
Equality test.
_qQuat | Object against which to test for equality. |
LSE_INLINE LSREAL LSE_FCALL lsm::CQuaternion::operator[] | ( | LSUINT32 | _ui32Index | ) | const |
Give array access.
_ui32Index | Index of the component to get. |
LSE_INLINE LSREAL &LSE_FCALL lsm::CQuaternion::operator[] | ( | LSUINT32 | _ui32Index | ) |
Give array access.
_ui32Index | Index of the component to get. |
CQuaternion& LSE_FCALL lsm::CQuaternion::Slerp | ( | const CQuaternion & | _qLeft, |
const CQuaternion & | _qRight, | ||
LSREAL | _fT | ||
) |
Spherical linear interpolation. Returns this object.
_qLeft | The starting quaternion. |
_qRight | The ending quaternion. |
_fT | Amount of interpolation. |
CQuaternion& LSE_FCALL lsm::CQuaternion::Squad | ( | const CQuaternion & | _qQ, |
const CQuaternion & | _qA, | ||
const CQuaternion & | _qB, | ||
const CQuaternion & | _qC, | ||
LSREAL | _fT | ||
) |
Spherical quadrangle interpolation. Returns this object.
_qQ | Operand 0. |
_qA | Operand 1. |
_qB | Operand 2. |
_qC | Operand 3. |
_fT | Amount to interpolate between the starting and ending points. |
LSE_INLINE LSVOID LSE_FCALL lsm::CQuaternion::ToRotationMatrix | ( | CMatrix4x4 & | _mMat | ) | const |
Create the rotation part of a 4-by-4 row-major matrix. The matrix members not related to the rotation are not modified.
_mMat | The matrix whose rotational components are to be built. |
LSE_INLINE LSREAL &LSE_FCALL lsm::CQuaternion::W | ( | ) |
Get the W value for read and write.
LSE_INLINE LSREAL &LSE_FCALL lsm::CQuaternion::X | ( | ) |
Get the X value for read and write.
LSE_INLINE LSREAL &LSE_FCALL lsm::CQuaternion::Y | ( | ) |
Get the Y value for read and write.
LSE_INLINE LSREAL &LSE_FCALL lsm::CQuaternion::Z | ( | ) |
Get the Z value for read and write.
LSREAL lsm::CQuaternion::x |
The components of the quaternion.