My Project
Public Member Functions | Static Public Member Functions | Public Attributes | Static Public Attributes | Protected Member Functions | Static Protected Member Functions | Static Protected Attributes | Friends | List of all members
ParaEngine::Matrix3 Class Reference

A 3x3 matrix which can represent rotations around axes. More...

#include <ParaMatrix3.h>

Public Member Functions

 Matrix3 ()
 Default constructor. More...
 
 Matrix3 (const float arr[3][3])
 
 Matrix3 (const Matrix3 &rkMatrix)
 
 Matrix3 (const Matrix4 &rkMatrix)
 
 Matrix3 (float fEntry00, float fEntry01, float fEntry02, float fEntry10, float fEntry11, float fEntry12, float fEntry20, float fEntry21, float fEntry22)
 
float * operator[] (size_t iRow) const
 
Vector3 GetColumn (size_t iCol) const
 
void SetColumn (size_t iCol, const Vector3 &vec)
 
void FromAxes (const Vector3 &xAxis, const Vector3 &yAxis, const Vector3 &zAxis)
 
Matrix3operator= (const Matrix3 &rkMatrix)
 
bool operator== (const Matrix3 &rkMatrix) const
 
bool operator!= (const Matrix3 &rkMatrix) const
 
Matrix3 operator+ (const Matrix3 &rkMatrix) const
 
Matrix3 operator- (const Matrix3 &rkMatrix) const
 
Matrix3 operator* (const Matrix3 &rkMatrix) const
 
Matrix3 operator- () const
 
Vector3 operator* (const Vector3 &rkVector) const
 
Matrix3 operator* (float fScalar) const
 
Matrix3 Transpose () const
 
bool Inverse (Matrix3 &rkInverse, float fTolerance=1e-06) const
 
Matrix3 Inverse (float fTolerance=1e-06) const
 
float Determinant () const
 
void SingularValueDecomposition (Matrix3 &rkL, Vector3 &rkS, Matrix3 &rkR) const
 
void SingularValueComposition (const Matrix3 &rkL, const Vector3 &rkS, const Matrix3 &rkR)
 
void Orthonormalize ()
 
void QDUDecomposition (Matrix3 &rkQ, Vector3 &rkD, Vector3 &rkU) const
 
float SpectralNorm () const
 
void ToAxisAngle (Vector3 &rkAxis, Radian &rfAngle) const
 
void ToAxisAngle (Vector3 &rkAxis, Degree &rfAngle) const
 
void FromAxisAngle (const Vector3 &rkAxis, const Radian &fRadians)
 
bool ToEulerAnglesXYZ (Radian &rfYAngle, Radian &rfPAngle, Radian &rfRAngle) const
 
bool ToEulerAnglesXZY (Radian &rfYAngle, Radian &rfPAngle, Radian &rfRAngle) const
 
bool ToEulerAnglesYXZ (Radian &rfYAngle, Radian &rfPAngle, Radian &rfRAngle) const
 
bool ToEulerAnglesYZX (Radian &rfYAngle, Radian &rfPAngle, Radian &rfRAngle) const
 
bool ToEulerAnglesZXY (Radian &rfYAngle, Radian &rfPAngle, Radian &rfRAngle) const
 
bool ToEulerAnglesZYX (Radian &rfYAngle, Radian &rfPAngle, Radian &rfRAngle) const
 
void FromEulerAnglesXYZ (const Radian &fYAngle, const Radian &fPAngle, const Radian &fRAngle)
 
void FromEulerAnglesXZY (const Radian &fYAngle, const Radian &fPAngle, const Radian &fRAngle)
 
void FromEulerAnglesYXZ (const Radian &fYAngle, const Radian &fPAngle, const Radian &fRAngle)
 
void FromEulerAnglesYZX (const Radian &fYAngle, const Radian &fPAngle, const Radian &fRAngle)
 
void FromEulerAnglesZXY (const Radian &fYAngle, const Radian &fPAngle, const Radian &fRAngle)
 
void FromEulerAnglesZYX (const Radian &fYAngle, const Radian &fPAngle, const Radian &fRAngle)
 
void EigenSolveSymmetric (float afEigenvalue[3], Vector3 akEigenvector[3]) const
 
bool hasScale () const
 Determines if this matrix involves a scaling. More...
 
void RotX (float angle)
 Set a rotation matrix around the X axis. More...
 
void RotY (float angle)
 Set a rotation matrix around the Y axis. More...
 
void RotZ (float angle)
 Set a rotation matrix around the Z axis. More...
 

Static Public Member Functions

static void TensorProduct (const Vector3 &rkU, const Vector3 &rkV, Matrix3 &rkProduct)
 

Public Attributes

union {
   struct {
      float   _11
 
      float   _12
 
      float   _13
 
      float   _21
 
      float   _22
 
      float   _23
 
      float   _31
 
      float   _32
 
      float   _33
 
   } 
 
   float   m [3][3]
 
}; 
 

Static Public Attributes

static const float EPSILON = 1e-06f
 
static const Matrix3 ZERO
 
static const Matrix3 IDENTITY
 

Protected Member Functions

void Tridiagonal (float afDiag[3], float afSubDiag[3])
 
bool QLAlgorithm (float afDiag[3], float afSubDiag[3])
 

Static Protected Member Functions

static void Bidiagonalize (Matrix3 &kA, Matrix3 &kL, Matrix3 &kR)
 
static void GolubKahanStep (Matrix3 &kA, Matrix3 &kL, Matrix3 &kR)
 
static float MaxCubicRoot (float afCoeff[3])
 

Static Protected Attributes

static const float ms_fSvdEpsilon = 1e-04f
 
static const unsigned int ms_iSvdMaxIterations = 32
 

Friends

class Matrix4
 
Vector3 operator* (const Vector3 &rkVector, const Matrix3 &rkMatrix)
 
Matrix3 operator* (float fScalar, const Matrix3 &rkMatrix)
 

Detailed Description

A 3x3 matrix which can represent rotations around axes.

Note
All the code is adapted from the Wild Magic 0.2 Matrix library (http://www.geometrictools.com/).
The coordinate system is assumed to be right-handed.

Constructor & Destructor Documentation

§ Matrix3()

ParaEngine::Matrix3::Matrix3 ( )
inline

Default constructor.

Note
It does NOT initialize the matrix for efficiency.

Member Function Documentation

§ hasScale()

bool ParaEngine::Matrix3::hasScale ( ) const
inline

Determines if this matrix involves a scaling.

§ RotX()

void ParaEngine::Matrix3::RotX ( float  angle)

Set a rotation matrix around the X axis.

1 0 0 RX = 0 cx sx 0 -sx cx

§ RotY()

void ParaEngine::Matrix3::RotY ( float  angle)

Set a rotation matrix around the Y axis.

cy 0 -sy RY = 0 1 0 sy 0 cy

§ RotZ()

void ParaEngine::Matrix3::RotZ ( float  angle)

Set a rotation matrix around the Z axis.

cz sz 0 RZ = -sz cz 0 0 0 1


The documentation for this class was generated from the following files: