"L. Spiro Engine"
Public Member Functions | Public Attributes | Static Protected Attributes

lsm::CQuaternion Class Reference

A quaternion. More...

#include <LSMQuaternion.h>

List of all members.

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]

Detailed Description

A quaternion.

Class CQuaternion Description: Quaternion in XYZW format.


Member Function Documentation

CQuaternion& LSE_FCALL lsm::CQuaternion::AddScaledVector ( const CVector3 _vVec,
LSREAL  _fTime 
)

Add a scaled vector.

Parameters:
_vVecThe vector to add after being scaled by _fTime.
_fTimeThe amount by which to scale _vVec before adding it to this queternion.
Returns:
Returns this quaternion after the addition.
LSE_INLINE CQuaternion LSE_FCALL lsm::CQuaternion::Conjugate ( ) const

Returns the conjugate of this quaternion.

Returns:
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.

Parameters:
_qQuatThe operand.
Returns:
Returns the dot product of this quaternion with another.
CQuaternion LSE_FCALL lsm::CQuaternion::Exp ( ) const

Returns the exponential of this quaternion.

Returns:
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.

Parameters:
_mMatThe matrix from which to build this quaternion.
Returns:
Returns this object after building it.
CQuaternion& LSE_FCALL lsm::CQuaternion::FromRotationVectors ( const CVector3  _vVectors[3])

Build from 3 vectors.

Parameters:
_vVectorsThe right, up, and forward vectors to use for building of the quaternion.
Returns:
Returns this object after building it.
LSE_INLINE CQuaternion &LSE_FCALL lsm::CQuaternion::Identity ( )

Functions on self. Sets this quaternion to an identity quaternion and returns itself.

Returns:
Returns this object after setting it to an identity quaternion.
LSE_INLINE CQuaternion LSE_FCALL lsm::CQuaternion::Inverse ( )

Returns the inverse of this quaternion.

Returns:
Returns the inverse of this quaternion.
LSE_INLINE LSREAL LSE_FCALL lsm::CQuaternion::Len ( ) const

Returns the length of this quaternion.

Returns:
Returns the length of this quaternion.
LSE_INLINE LSREAL LSE_FCALL lsm::CQuaternion::LenSq ( ) const

Returns the squared length of this quaternion.

Returns:
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.

Parameters:
_qLeftStarting point.
_qRightEnding point.
_fTAmount to interpolate between the starting and ending points.
Returns:
Returns this object after interpolating linearly.
CQuaternion LSE_FCALL lsm::CQuaternion::Log ( ) const

Returns the natural log of this quaternion.

Returns:
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.

Parameters:
_qQuatObject against which to test for inequality.
Returns:
Returns true if any component on this quaternion are different from those on _qQuat.
LSE_INLINE CQuaternion LSE_FCALL lsm::CQuaternion::operator* ( LSREAL  _fVal) const

Multiplication operator.

Parameters:
_fValThe operand.
Returns:
Returns the resulting quaternion.
LSE_INLINE CQuaternion LSE_FCALL lsm::CQuaternion::operator* ( const CQuaternion _qQuat) const

Multiplication operator.

Parameters:
_qQuatThe operand.
Returns:
Returns the resulting quaternion.
LSE_INLINE CQuaternion &LSE_FCALL lsm::CQuaternion::operator*= ( const CQuaternion _qQuat)

Muliplication assignment operator.

Parameters:
_qQuatThe quaternion to multiply by this quaternion.
Returns:
Returns the resulting quaternion.
LSE_INLINE CQuaternion &LSE_FCALL lsm::CQuaternion::operator*= ( LSREAL  _fVal)

Muliplication assignment operator on a per-component basis.

Parameters:
_fValThe value by which to multiply each component in this quaternion.
Returns:
Returns the resulting quaternion.
LSE_INLINE CQuaternion LSE_FCALL lsm::CQuaternion::operator+ ( const CQuaternion _qQuat) const

Addition operator.

Parameters:
_qQuatThe operand.
Returns:
Returns the resulting quaternion.
LSE_INLINE CQuaternion LSE_FCALL lsm::CQuaternion::operator+ ( ) const

Unary +.

Returns:
Returns this quaternion.
LSE_INLINE CQuaternion &LSE_FCALL lsm::CQuaternion::operator+= ( const CQuaternion _qQuat)

Addition assignment operator.

Parameters:
_qQuatThe quaternion to add to this quaternion.
Returns:
Returns the resulting quaternion.
LSE_INLINE CQuaternion LSE_FCALL lsm::CQuaternion::operator- ( const CQuaternion _qQuat) const

Subtraction operator.

Parameters:
_qQuatThe operand.
Returns:
Returns the resulting quaternion.
LSE_INLINE CQuaternion LSE_FCALL lsm::CQuaternion::operator- ( ) const

Unary -.

Returns:
Returns the negative of this quaternion.
LSE_INLINE CQuaternion &LSE_FCALL lsm::CQuaternion::operator-= ( const CQuaternion _qQuat)

Subtraction assignment operator.

Parameters:
_qQuatThe quaternion to subtract from this quaternion.
Returns:
Returns the resulting quaternion.
LSE_INLINE CQuaternion LSE_FCALL lsm::CQuaternion::operator/ ( LSREAL  _fVal) const

Division operator.

Parameters:
_fValThe operand.
Returns:
Returns the resulting quaternion.
LSE_INLINE CQuaternion &LSE_FCALL lsm::CQuaternion::operator/= ( LSREAL  _fVal)

Division assignment operator on a per-component basis.

Parameters:
_fValThe value by which to divide each component in this quaternion.
Returns:
Returns the resulting quaternion.
LSE_INLINE bool LSE_FCALL lsm::CQuaternion::operator== ( const CQuaternion _qQuat) const

Equality test.

Parameters:
_qQuatObject against which to test for equality.
Returns:
Returns true if all components on this quaternion are the same as on _qQuat.
LSE_INLINE LSREAL LSE_FCALL lsm::CQuaternion::operator[] ( LSUINT32  _ui32Index) const

Give array access.

Parameters:
_ui32IndexIndex of the component to get.
Returns:
Returns the component at the given index.
LSE_INLINE LSREAL &LSE_FCALL lsm::CQuaternion::operator[] ( LSUINT32  _ui32Index)

Give array access.

Parameters:
_ui32IndexIndex of the component to get.
Returns:
Returns the component at the given index.
CQuaternion& LSE_FCALL lsm::CQuaternion::Slerp ( const CQuaternion _qLeft,
const CQuaternion _qRight,
LSREAL  _fT 
)

Spherical linear interpolation. Returns this object.

Parameters:
_qLeftThe starting quaternion.
_qRightThe ending quaternion.
_fTAmount of interpolation.
Returns:
Returns this object after 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.

Parameters:
_qQOperand 0.
_qAOperand 1.
_qBOperand 2.
_qCOperand 3.
_fTAmount to interpolate between the starting and ending points.
Returns:
Returns this object after interpolation.
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.

Parameters:
_mMatThe matrix whose rotational components are to be built.
LSE_INLINE LSREAL &LSE_FCALL lsm::CQuaternion::W ( )

Get the W value for read and write.

Returns:
Returns the W value for read and write.
LSE_INLINE LSREAL &LSE_FCALL lsm::CQuaternion::X ( )

Get the X value for read and write.

Returns:
Returns the X value for read and write.
LSE_INLINE LSREAL &LSE_FCALL lsm::CQuaternion::Y ( )

Get the Y value for read and write.

Returns:
Returns the Y value for read and write.
LSE_INLINE LSREAL &LSE_FCALL lsm::CQuaternion::Z ( )

Get the Z value for read and write.

Returns:
Returns the Z value for read and write.

Member Data Documentation

The components of the quaternion.


The documentation for this class was generated from the following file:
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator