This class represents a generic 3x3 matrix. More...
#include "Matrix3x3.hpp"
Public Member Functions | |
Matrix3x3T () | |
The default constructor for creating a "1" (identity) matrix. More... | |
Matrix3x3T (const float M[3][3]) | |
Constructor for creating an arbitrary matrix. More... | |
Matrix3x3T (const double M[3][3]) | |
Constructor for creating an arbitrary matrix. More... | |
Matrix3x3T (T m00, T m01, T m02, T m10, T m11, T m12, T m20, T m21, T m22) | |
Constructor for creating an arbitrary matrix. More... | |
Matrix3x3T (const AnglesT< T > &Angles) | |
Constructs a rotation matrix from the given angles. More... | |
Matrix3x3T (const QuaternionT< T > &Quat) | |
Constructs a rotation matrix from the given quaternion. More... | |
T * | operator[] (unsigned long i) |
Returns the i-th row of this matrix. More... | |
const T * | operator[] (unsigned long i) const |
Returns the i-th row of this matrix. More... | |
Vector3T< T > | GetAxis (unsigned int i) const |
Returns the i-th column of this matrix. More... | |
Matrix3x3T | operator* (const Matrix3x3T &Other) const |
Computes M*Other, that is, the matrix product of this and the Other matrix. More... | |
Vector3T< T > | operator* (const Vector3T< T > &v) const |
Computes M*v, where M is this matrix. More... | |
bool | operator== (const Matrix3x3T &Other) const |
Determines if this matrix is equal to Other. More... | |
bool | operator!= (const Matrix3x3T &Other) const |
Determines if this matrix is not equal to Other. More... | |
void | Scale_MS (T sx, T sy, T sz) |
Computes M=M*S, where S=GetScaleMatrix (sx, sy, sz). More... | |
void | Scale_SM (T sx, T sy, T sz) |
Computes M=S*M, where S=GetScaleMatrix (sx, sy, sz). More... | |
void | RotateX_MR (T Angle) |
Computes M=M*R, where R=GetRotateXMatrix (Angle). More... | |
void | RotateX_RM (T Angle) |
Computes M=R*M, where R=GetRotateXMatrix (Angle). More... | |
void | RotateY_MR (T Angle) |
Computes M=M*R, where R=GetRotateYMatrix (Angle). More... | |
void | RotateY_RM (T Angle) |
Computes M=R*M, where R=GetRotateYMatrix (Angle). More... | |
void | RotateZ_MR (T Angle) |
Computes M=M*R, where R=GetRotateZMatrix (Angle). More... | |
void | RotateZ_RM (T Angle) |
Computes M=R*M, where R=GetRotateZMatrix (Angle). More... | |
bool | IsEqual (const Matrix3x3T &Other, const T Epsilon=0) const |
Returns whether this matrix is equal to Other. More... | |
Vector3T< T > | Mul (const Vector3T< T > &v) const |
Computes M*v, where M is this matrix. More... | |
Vector3T< T > | MulTranspose (const Vector3T< T > &v) const |
A shortcut for M.GetTranspose()*v, where M is this matrix. More... | |
void | Mul (const T v[3], T out[3]) const |
Computes M*v, where M is this matrix. More... | |
Matrix3x3T | GetInverse (bool *Result=NULL) const |
Computes the inverse of this matrix. More... | |
Matrix3x3T | GetTranspose () const |
Returns the transpose of this matrix. More... | |
AnglesT< T > | ToAngles_COMPAT () const |
Converts the rotation that is described by this matrix to an AnglesT<T> instance that describes the same rotation. More... | |
Static Public Member Functions | |
Named constructors. | |
static Matrix3x3T | GetScaleMatrix (T sx, T sy, T sz) |
Returns a scale matrix with scale factors (sx sy sz). More... | |
static Matrix3x3T | GetRotateXMatrix (T Angle) |
Returns a rotation matrix about Angle degrees around the x-axis. More... | |
static Matrix3x3T | GetRotateYMatrix (T Angle) |
Returns a rotation matrix about Angle degrees around the y-axis. More... | |
static Matrix3x3T | GetRotateZMatrix (T Angle) |
Returns a rotation matrix about Angle degrees around the z-axis. More... | |
static Matrix3x3T | GetRotateMatrix (T Angle, const Vector3T< T > &Axis) |
Returns a rotation matrix about Angle degrees around Axis. More... | |
static Matrix3x3T | GetFromAngles_COMPAT (const AnglesT< T > &Angles) |
Returns a rotation matrix built from the given angles in a "compatibility-to-old-code" fashion. More... | |
Public Attributes | |
T | m [3][3] |
The matrix values. More... | |
Static Public Attributes | |
static const Matrix3x3T< T > | Identity |
Identity matrix. More... | |
This class represents a generic 3x3 matrix.
|
inline |
The default constructor for creating a "1" (identity) matrix.
|
inline |
Constructor for creating an arbitrary matrix.
|
inline |
Constructor for creating an arbitrary matrix.
|
inline |
Constructor for creating an arbitrary matrix.
Matrix3x3T::Matrix3x3T | ( | const AnglesT< T > & | Angles | ) |
Constructs a rotation matrix from the given angles.
See the documentation of the AnglesT class for details.
Matrix3x3T::Matrix3x3T | ( | const QuaternionT< T > & | Quat | ) |
Constructs a rotation matrix from the given quaternion.
|
inline |
Returns the i-th column of this matrix.
The i-th column of the matrix corresponds to the i-th axis of the represented coordinate-system.
|
static |
Returns a rotation matrix built from the given angles in a "compatibility-to-old-code" fashion.
Matrix3x3T< T > Matrix3x3T::GetInverse | ( | bool * | Result = NULL | ) | const |
Computes the inverse of this matrix.
Result | Whether the operation was successful. |
*Result
, if not at NULL
, is set to true
. Otherwise, an undefined matrix is returned, and *Result
, if not at NULL
, is set to false
.
|
static |
Returns a rotation matrix about Angle degrees around Axis.
|
static |
Returns a rotation matrix about Angle degrees around the x-axis.
|
static |
Returns a rotation matrix about Angle degrees around the y-axis.
|
static |
Returns a rotation matrix about Angle degrees around the z-axis.
|
static |
Returns a scale matrix with scale factors (sx sy sz).
Matrix3x3T< T > Matrix3x3T::GetTranspose | ( | ) | const |
Returns the transpose of this matrix.
|
inline |
Returns whether this matrix is equal to Other.
The matrices are considered equal if the element-wise comparison yields no difference larger than Epsilon.
Other | Matrix to compare to. |
Epsilon | Tolerance value. |
|
inline |
Computes M*v, where M is this matrix.
v | A vector. |
|
inline |
Computes M*v, where M is this matrix.
v | The three-component vector that is multiplied with M. |
out | The three-component result vector. |
|
inline |
A shortcut for M.GetTranspose()*v, where M is this matrix.
v | A vector. |
|
inline |
Determines if this matrix is not equal to Other.
Note that this is a bit-wise comparison, no epsilon is taken into account.
Other | The other matrix (right side). |
Matrix3x3T< T > Matrix3x3T::operator* | ( | const Matrix3x3T< T > & | Other | ) | const |
Computes M*Other, that is, the matrix product of this and the Other matrix.
Other | The other matrix (right side). |
|
inline |
Computes M*v, where M is this matrix.
v | A vector. |
|
inline |
Determines if this matrix is equal to Other.
Note that this is a bit-wise comparison, no epsilon is taken into account.
Other | The other matrix (right side). |
|
inline |
Returns the i-th row of this matrix.
|
inline |
Returns the i-th row of this matrix.
void Matrix3x3T::RotateX_MR | ( | T | Angle | ) |
Computes M=M*R, where R=GetRotateXMatrix (Angle).
void Matrix3x3T::RotateX_RM | ( | T | Angle | ) |
Computes M=R*M, where R=GetRotateXMatrix (Angle).
void Matrix3x3T::RotateY_MR | ( | T | Angle | ) |
Computes M=M*R, where R=GetRotateYMatrix (Angle).
void Matrix3x3T::RotateY_RM | ( | T | Angle | ) |
Computes M=R*M, where R=GetRotateYMatrix (Angle).
void Matrix3x3T::RotateZ_MR | ( | T | Angle | ) |
Computes M=M*R, where R=GetRotateZMatrix (Angle).
void Matrix3x3T::RotateZ_RM | ( | T | Angle | ) |
Computes M=R*M, where R=GetRotateZMatrix (Angle).
void Matrix3x3T::Scale_MS | ( | T | sx, |
T | sy, | ||
T | sz | ||
) |
Computes M=M*S, where S=GetScaleMatrix (sx, sy, sz).
void Matrix3x3T::Scale_SM | ( | T | sx, |
T | sy, | ||
T | sz | ||
) |
Computes M=S*M, where S=GetScaleMatrix (sx, sy, sz).
AnglesT< T > Matrix3x3T::ToAngles_COMPAT | ( | ) | const |
Converts the rotation that is described by this matrix to an AnglesT<T> instance that describes the same rotation.
|
static |
Identity matrix.
T cf::math::Matrix3x3T< T >::m[3][3] |
The matrix values.