MQuaternion Class Reference

Mathematical Quaternion (Used for Rotation). More...

#include <MercuryTypes.h>

List of all members.

Public Member Functions

 MQuaternion ()
 MQuaternion (float W, float X, float Y, float Z)
 MQuaternion (float *wxyz)
 MQuaternion (const MercuryPoint &p)
void SetEuler (const MercuryPoint &angles)
 Make this quaternion represent to a set of euler angles.
void CreateFromAxisAngle (const MercuryPoint &p, const float radians)
 Make the quaternion represent a given angle radians around an axis p.
float & operator[] (const int rhs)
 Access a component of the quaternion with the [] operator.
const float & operator[] (const int rhs) const
float magnitude () const
 Returns the magnitude.
MQuaternion normalize () const
 Returns the normalized Quaternion.
MQuaternion conjugate () const
 Returns the conjugate Quaternion.
MQuaternion reciprocal () const
 Returns the reciprocal Quaternion.
MQuaternion rotateAbout (const MQuaternion &spinAxis) const
 Rotates Quaternion about another Quaternion.
void toMatrix (MercuryMatrix &mat) const
 Converts Quaternion to 4x4 Matrix(3x3 Spatial).
void toMatrix4 (MercuryMatrix &mat) const
 Converts Quaternion to complete 4x4 Matrix.
MercuryPoint ToPoint ()
 Convert the quaternion to a point.
MQuaternion operator+ (const MQuaternion &rhs) const
MQuaternion operator- (const MQuaternion &rhs) const
MQuaternion operator * (const MQuaternion &rhs) const
MQuaternionoperator= (const MQuaternion &rhs)
MQuaternionoperator+= (const MQuaternion &rhs)
MQuaternionoperator-= (const MQuaternion &rhs)
MQuaternionoperator *= (const MQuaternion &rhs)
MQuaternion operator * (const float &rhs) const
MQuaternion operator/ (const float &rhs) const
MQuaternionoperator *= (const float &rhs)
MQuaternionoperator/= (const float &rhs)

Public Attributes

float w
float x
float y
float z


Detailed Description

Mathematical Quaternion (Used for Rotation).

Definition at line 115 of file MercuryTypes.h.


Constructor & Destructor Documentation

MQuaternion::MQuaternion (  )  [inline]

Definition at line 119 of file MercuryTypes.h.

MQuaternion::MQuaternion ( float  W,
float  X,
float  Y,
float  Z 
) [inline]

Definition at line 120 of file MercuryTypes.h.

MQuaternion::MQuaternion ( float *  wxyz  )  [inline]

Definition at line 121 of file MercuryTypes.h.

MQuaternion::MQuaternion ( const MercuryPoint p  )  [inline]

Definition at line 122 of file MercuryTypes.h.


Member Function Documentation

void MQuaternion::SetEuler ( const MercuryPoint angles  ) 

Make this quaternion represent to a set of euler angles.

Definition at line 302 of file MercuryTypes.cpp.

void MQuaternion::CreateFromAxisAngle ( const MercuryPoint p,
const float  radians 
)

Make the quaternion represent a given angle radians around an axis p.

Definition at line 323 of file MercuryTypes.cpp.

float & MQuaternion::operator[] ( const int  rhs  ) 

Access a component of the quaternion with the [] operator.

Definition at line 290 of file MercuryTypes.cpp.

const float& MQuaternion::operator[] ( const int  rhs  )  const

float MQuaternion::magnitude (  )  const

Returns the magnitude.

Definition at line 333 of file MercuryTypes.cpp.

MQuaternion MQuaternion::normalize (  )  const

Returns the normalized Quaternion.

Definition at line 338 of file MercuryTypes.cpp.

MQuaternion MQuaternion::conjugate (  )  const

Returns the conjugate Quaternion.

Definition at line 343 of file MercuryTypes.cpp.

MQuaternion MQuaternion::reciprocal (  )  const

Returns the reciprocal Quaternion.

Definition at line 349 of file MercuryTypes.cpp.

MQuaternion MQuaternion::rotateAbout ( const MQuaternion spinAxis  )  const

Rotates Quaternion about another Quaternion.

Definition at line 355 of file MercuryTypes.cpp.

void MQuaternion::toMatrix ( MercuryMatrix mat  )  const

Converts Quaternion to 4x4 Matrix(3x3 Spatial).

Definition at line 360 of file MercuryTypes.cpp.

void MQuaternion::toMatrix4 ( MercuryMatrix mat  )  const

Converts Quaternion to complete 4x4 Matrix.

Definition at line 385 of file MercuryTypes.cpp.

MercuryPoint MQuaternion::ToPoint (  )  [inline]

Convert the quaternion to a point.

Definition at line 149 of file MercuryTypes.h.

MQuaternion MQuaternion::operator+ ( const MQuaternion rhs  )  const

Definition at line 399 of file MercuryTypes.cpp.

MQuaternion MQuaternion::operator- ( const MQuaternion rhs  )  const

Definition at line 409 of file MercuryTypes.cpp.

MQuaternion MQuaternion::operator * ( const MQuaternion rhs  )  const

Definition at line 419 of file MercuryTypes.cpp.

MQuaternion & MQuaternion::operator= ( const MQuaternion rhs  ) 

Definition at line 429 of file MercuryTypes.cpp.

MQuaternion & MQuaternion::operator+= ( const MQuaternion rhs  ) 

Definition at line 438 of file MercuryTypes.cpp.

MQuaternion & MQuaternion::operator-= ( const MQuaternion rhs  ) 

Definition at line 446 of file MercuryTypes.cpp.

MQuaternion & MQuaternion::operator *= ( const MQuaternion rhs  ) 

Definition at line 454 of file MercuryTypes.cpp.

MQuaternion MQuaternion::operator * ( const float &  rhs  )  const

Definition at line 462 of file MercuryTypes.cpp.

MQuaternion MQuaternion::operator/ ( const float &  rhs  )  const

Definition at line 471 of file MercuryTypes.cpp.

MQuaternion & MQuaternion::operator *= ( const float &  rhs  ) 

Definition at line 480 of file MercuryTypes.cpp.

MQuaternion & MQuaternion::operator/= ( const float &  rhs  ) 

Definition at line 488 of file MercuryTypes.cpp.


Member Data Documentation

float MQuaternion::w

Definition at line 118 of file MercuryTypes.h.

float MQuaternion::x

Definition at line 118 of file MercuryTypes.h.

float MQuaternion::y

Definition at line 118 of file MercuryTypes.h.

float MQuaternion::z

Definition at line 118 of file MercuryTypes.h.


The documentation for this class was generated from the following files:
Hosted by SourceForge.net Logo