Loading...
Searching...
No Matches
Ogre::Matrix3 Class Reference
Core » Math

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

`#include <OgreMatrix3.h>`

## Public Member Functions

| Matrix3 ()
| Default constructor.
| Matrix3 (const Real arr[3][3])
| Matrix3 (Real fEntry00, Real fEntry01, Real fEntry02, Real fEntry10, Real fEntry11, Real fEntry12, Real fEntry20, Real fEntry21, Real fEntry22)
Real | Determinant () const
Real | determinant () const
void | EigenSolveSymmetric (Real afEigenvalue[3], Vector3 akEigenvector[3]) const
| Eigensolver, matrix must be symmetric.
void | FromAngleAxis (const Vector3 &rkAxis, const Radian &fRadians)
void | FromAxes (const Vector3 &xAxis, const Vector3 &yAxis, const Vector3 &zAxis)
Vector3 | GetColumn (size_t iCol) const
bool | hasNegativeScale () const
| Determines if this matrix involves a negative scaling.
bool | hasScale () const
| Determines if this matrix involves a scaling.
bool | Inverse (Matrix3 &rkInverse, Real fTolerance=1e-06f) const
Matrix3 | Inverse (Real fTolerance=1e-06f) const
Matrix3 | inverse () const
bool | operator!= (const Matrix3 &rkMatrix) const
| Tests 2 matrices for inequality.
Matrix3 | operator* (const Matrix3 &rkMatrix) const
| Matrix concatenation using '*'.
Matrix3 | operator* (Real fScalar) const
| Matrix * scalar.
Matrix3 | operator+ (const Matrix3 &rkMatrix) const
| Matrix addition.
Matrix3 | operator- () const
Matrix3 | operator- (const Matrix3 &rkMatrix) const
| Matrix subtraction.
bool | operator== (const Matrix3 &rkMatrix) const
| Tests 2 matrices for equality.
Real * | operator[] (size_t iRow)
const Real * | operator[] (size_t iRow) const
| Member access, allows use of construct mat[r][c].
Matrix3 | orthonormalised () const
| Gram-Schmidt orthogonalisation (applied to columns of rotation matrix).
void | Orthonormalize ()
void | QDUDecomposition (Matrix3 &rkQ, Vector3 &rkD, Vector3 &rkU) const
| Orthogonal Q, diagonal D, upper triangular U stored as (u01,u02,u12).
void | SetColumn (size_t iCol, const Vector3 &vec)
void | SingularValueComposition (const Matrix3 &rkL, const Vector3 &rkS, const Matrix3 &rkR)
void | SingularValueDecomposition (Matrix3 &rkL, Vector3 &rkS, Matrix3 &rkR) const
| Singular value decomposition.
Real | SpectralNorm () const
void | ToAngleAxis (Vector3 &rkAxis, Degree &rfAngle) const
void | ToAngleAxis (Vector3 &rkAxis, Radian &rfAngle) const
| Note: Matrix must be orthonormal.
Matrix3 | Transpose () const
Matrix3 | transpose () const
Euler angle conversions

(De-)composes the matrix in/ from yaw, pitch and roll angles, where yaw is rotation about the Y vector, pitch is rotation about the X axis, and roll is rotation about the Z axis.

The function suffix indicates the (de-)composition order; e.g. with the YXZ variants the matrix will be (de-)composed as yaw*pitch*roll

For ToEulerAngles*, the return value denotes whether the solution is unique.

Note
  The matrix to be decomposed must be orthonormal.

bool | ToEulerAnglesXYZ (Radian &xAngle, Radian &yAngle, Radian &zAngle) const
bool | ToEulerAnglesXZY (Radian &xAngle, Radian &zAngle, Radian &yAngle) const
bool | ToEulerAnglesYXZ (Radian &yAngle, Radian &xAngle, Radian &zAngle) const
bool | ToEulerAnglesYZX (Radian &yAngle, Radian &zAngle, Radian &xAngle) const
bool | ToEulerAnglesZXY (Radian &zAngle, Radian &xAngle, Radian &yAngle) const
bool | ToEulerAnglesZYX (Radian &zAngle, Radian &yAngle, Radian &xAngle) const
void | FromEulerAnglesXYZ (const Radian &xAngle, const Radian &yAngle, const Radian &zAngle)
void | FromEulerAnglesXZY (const Radian &xAngle, const Radian &zAngle, const Radian &yAngle)
void | FromEulerAnglesYXZ (const Radian &yAngle, const Radian &xAngle, const Radian &zAngle)
void | FromEulerAnglesYZX (const Radian &yAngle, const Radian &zAngle, const Radian &xAngle)
void | FromEulerAnglesZXY (const Radian &zAngle, const Radian &xAngle, const Radian &yAngle)
void | FromEulerAnglesZYX (const Radian &zAngle, const Radian &yAngle, const Radian &xAngle)

## Static Public Member Functions

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

## Static Public Attributes

static const Real | EPSILON
static const Matrix3 | IDENTITY
static const Matrix3 | ZERO

## 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() [1/3]

Ogre::Matrix3::Matrix3 | ( |  | ) |

inline

Default constructor.

Note
  It does NOT initialize the matrix for efficiency.

Referenced by Inverse(), Inverse(), inverse(), operator!=(), operator*(), operator*, operator*(), operator*, operator+(), operator-(), operator-(), operator<<, operator==(), orthonormalised(), QDUDecomposition(), SingularValueComposition(), SingularValueDecomposition(), TensorProduct(), Transpose(), and transpose().

## Matrix3() [2/3]

Ogre::Matrix3::Matrix3 | ( | const Real | arr[3][3] | ) |

inline explicit

## Matrix3() [3/3]

Ogre::Matrix3::Matrix3 | ( | Real | fEntry00,
|  | Real | fEntry01,
|  | Real | fEntry02,
|  | Real | fEntry10,
|  | Real | fEntry11,
|  | Real | fEntry12,
|  | Real | fEntry20,
|  | Real | fEntry21,
|  | Real | fEntry22 )

inline

## Member Function Documentation

## operator[]() [1/2]

const Real * Ogre::Matrix3::operator[] | ( | size_t | iRow | ) | const

inline

Member access, allows use of construct mat[r][c].

## operator[]() [2/2]

Real * Ogre::Matrix3::operator[] | ( | size_t | iRow | ) |

inline

## GetColumn()

Vector3 Ogre::Matrix3::GetColumn | ( | size_t | iCol | ) | const

inline

Referenced by orthonormalised().

## SetColumn()

void Ogre::Matrix3::SetColumn | ( | size_t | iCol,
|  | const Vector3 & | vec )

inline

Referenced by FromAxes(), and orthonormalised().

## FromAxes()

void Ogre::Matrix3::FromAxes | ( | const Vector3 & | xAxis,
|  | const Vector3 & | yAxis,
|  | const Vector3 & | zAxis )

inline

References SetColumn().

Referenced by Ogre::Math::lookRotation().

## operator==()

bool Ogre::Matrix3::operator== | ( | const Matrix3 & | rkMatrix | ) | const

Tests 2 matrices for equality.

References Matrix3().

Referenced by operator!=().

## operator!=()

bool Ogre::Matrix3::operator!= | ( | const Matrix3 & | rkMatrix | ) | const

inline

Tests 2 matrices for inequality.

References Matrix3(), and operator==().

## operator+()

Matrix3 Ogre::Matrix3::operator+ | ( | const Matrix3 & | rkMatrix | ) | const

Matrix addition.

References Matrix3().

## operator-() [1/2]

Matrix3 Ogre::Matrix3::operator- | ( | const Matrix3 & | rkMatrix | ) | const

Matrix subtraction.

References Matrix3().

## operator*() [1/2]

Matrix3 Ogre::Matrix3::operator* | ( | const Matrix3 & | rkMatrix | ) | const

Matrix concatenation using '*'.

References Matrix3().

## operator-() [2/2]

Matrix3 Ogre::Matrix3::operator- | ( |  | ) | const

References Matrix3().

## operator*() [2/2]

Matrix3 Ogre::Matrix3::operator* | ( | Real | fScalar | ) | const

Matrix * scalar.

References Matrix3().

## Transpose()

Matrix3 Ogre::Matrix3::Transpose | ( |  | ) | const

References Matrix3().

Referenced by transpose().

## Inverse() [1/2]

bool Ogre::Matrix3::Inverse | ( | Matrix3 & | rkInverse,
|  | Real | fTolerance = 1e-06f ) const

References Matrix3().

Referenced by inverse().

## Inverse() [2/2]

Matrix3 Ogre::Matrix3::Inverse | ( | Real | fTolerance = 1e-06f | ) | const

References Matrix3().

## Determinant()

Real Ogre::Matrix3::Determinant | ( |  | ) | const

inline

References determinant().

## transpose()

Matrix3 Ogre::Matrix3::transpose | ( |  | ) | const

inline

References Matrix3(), and Transpose().

## inverse()

Matrix3 Ogre::Matrix3::inverse | ( |  | ) | const

inline

References Matrix3(), and Inverse().

## determinant()

Real Ogre::Matrix3::determinant | ( |  | ) | const

inline

Referenced by Determinant(), and hasNegativeScale().

## hasNegativeScale()

bool Ogre::Matrix3::hasNegativeScale | ( |  | ) | const

inline

Determines if this matrix involves a negative scaling.

References determinant().

## SingularValueDecomposition()

void Ogre::Matrix3::SingularValueDecomposition | ( | Matrix3 & | rkL,
|  | Vector3 & | rkS,
|  | Matrix3 & | rkR ) const

Singular value decomposition.

References Matrix3().

## SingularValueComposition()

void Ogre::Matrix3::SingularValueComposition | ( | const Matrix3 & | rkL,
|  | const Vector3 & | rkS,
|  | const Matrix3 & | rkR )

References Matrix3().

## orthonormalised()

Matrix3 Ogre::Matrix3::orthonormalised | ( |  | ) | const

inline

Gram-Schmidt orthogonalisation (applied to columns of rotation matrix).

References Matrix3(), Ogre::Vector< dims, T >::dotProduct(), GetColumn(), and SetColumn().

Referenced by Orthonormalize().

## Orthonormalize()

void Ogre::Matrix3::Orthonormalize | ( |  | ) |

inline

Deprecated

References orthonormalised().

## QDUDecomposition()

void Ogre::Matrix3::QDUDecomposition | ( | Matrix3 & | rkQ,
|  | Vector3 & | rkD,
|  | Vector3 & | rkU ) const

Orthogonal Q, diagonal D, upper triangular U stored as (u01,u02,u12).

References Matrix3().

## SpectralNorm()

Real Ogre::Matrix3::SpectralNorm | ( |  | ) | const

## ToAngleAxis() [1/2]

void Ogre::Matrix3::ToAngleAxis | ( | Vector3 & | rkAxis,
|  | Radian & | rfAngle ) const

Note: Matrix must be orthonormal.

Referenced by ToAngleAxis().

## ToAngleAxis() [2/2]

void Ogre::Matrix3::ToAngleAxis | ( | Vector3 & | rkAxis,
|  | Degree & | rfAngle ) const

inline

References ToAngleAxis().

## FromAngleAxis()

void Ogre::Matrix3::FromAngleAxis | ( | const Vector3 & | rkAxis,
|  | const Radian & | fRadians )

## ToEulerAnglesXYZ()

bool Ogre::Matrix3::ToEulerAnglesXYZ | ( | Radian & | xAngle,
|  | Radian & | yAngle,
|  | Radian & | zAngle ) const

## ToEulerAnglesXZY()

bool Ogre::Matrix3::ToEulerAnglesXZY | ( | Radian & | xAngle,
|  | Radian & | zAngle,
|  | Radian & | yAngle ) const

## ToEulerAnglesYXZ()

bool Ogre::Matrix3::ToEulerAnglesYXZ | ( | Radian & | yAngle,
|  | Radian & | xAngle,
|  | Radian & | zAngle ) const

## ToEulerAnglesYZX()

bool Ogre::Matrix3::ToEulerAnglesYZX | ( | Radian & | yAngle,
|  | Radian & | zAngle,
|  | Radian & | xAngle ) const

## ToEulerAnglesZXY()

bool Ogre::Matrix3::ToEulerAnglesZXY | ( | Radian & | zAngle,
|  | Radian & | xAngle,
|  | Radian & | yAngle ) const

## ToEulerAnglesZYX()

bool Ogre::Matrix3::ToEulerAnglesZYX | ( | Radian & | zAngle,
|  | Radian & | yAngle,
|  | Radian & | xAngle ) const

## FromEulerAnglesXYZ()

void Ogre::Matrix3::FromEulerAnglesXYZ | ( | const Radian & | xAngle,
|  | const Radian & | yAngle,
|  | const Radian & | zAngle )

## FromEulerAnglesXZY()

void Ogre::Matrix3::FromEulerAnglesXZY | ( | const Radian & | xAngle,
|  | const Radian & | zAngle,
|  | const Radian & | yAngle )

## FromEulerAnglesYXZ()

void Ogre::Matrix3::FromEulerAnglesYXZ | ( | const Radian & | yAngle,
|  | const Radian & | xAngle,
|  | const Radian & | zAngle )

## FromEulerAnglesYZX()

void Ogre::Matrix3::FromEulerAnglesYZX | ( | const Radian & | yAngle,
|  | const Radian & | zAngle,
|  | const Radian & | xAngle )

## FromEulerAnglesZXY()

void Ogre::Matrix3::FromEulerAnglesZXY | ( | const Radian & | zAngle,
|  | const Radian & | xAngle,
|  | const Radian & | yAngle )

## FromEulerAnglesZYX()

void Ogre::Matrix3::FromEulerAnglesZYX | ( | const Radian & | zAngle,
|  | const Radian & | yAngle,
|  | const Radian & | xAngle )

## EigenSolveSymmetric()

void Ogre::Matrix3::EigenSolveSymmetric | ( | Real | afEigenvalue[3],
|  | Vector3 | akEigenvector[3] ) const

Eigensolver, matrix must be symmetric.

## TensorProduct()

void Ogre::Matrix3::TensorProduct | ( | const Vector3 & | rkU,
|  | const Vector3 & | rkV,
|  | Matrix3 & | rkProduct )

static

References Matrix3().

## hasScale()

bool Ogre::Matrix3::hasScale | ( |  | ) | const

inline

Determines if this matrix involves a scaling.

References Ogre::Math::RealEqual().

## Member Data Documentation

## EPSILON

const Real Ogre::Matrix3::EPSILON

static

## ZERO

const Matrix3 Ogre::Matrix3::ZERO

static

## IDENTITY

const Matrix3 Ogre::Matrix3::IDENTITY

static

Referenced by Ogre::StringConverter::parseMatrix3().

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

- OgreMatrix3.h