PixelLightAPI
.
|
3x3 matrix More...
#include <Matrix3x3.h>
Public Member Functions | |
Matrix3x3 () | |
Default constructor setting an identity matrix. | |
Matrix3x3 (const float fS[]) | |
Matrix3x3 (const Matrix3x3 &mM) | |
PLMATH_API | Matrix3x3 (const Matrix3x4 &mM) |
PLMATH_API | Matrix3x3 (const Matrix4x4 &mM) |
Matrix3x3 (float fXX, float fXY, float fXZ, float fYX, float fYY, float fYZ, float fZX, float fZY, float fZZ) | |
~Matrix3x3 () | |
PLMATH_API bool | operator== (const Matrix3x3 &mM) const |
PLMATH_API bool | operator!= (const Matrix3x3 &mM) const |
PLMATH_API bool | CompareScale (const Matrix3x3 &mM, float fEpsilon=Math::Epsilon) const |
PLMATH_API bool | CompareRotation (const Matrix3x3 &mM, float fEpsilon=Math::Epsilon) const |
Matrix3x3 & | operator= (const float fS[]) |
Matrix3x3 & | operator= (const Matrix3x3 &mM) |
PLMATH_API Matrix3x3 & | operator= (const Matrix3x4 &mM) |
PLMATH_API Matrix3x3 & | operator= (const Matrix4x4 &mM) |
Matrix3x3 | operator+ (const Matrix3x3 &mM) const |
void | operator+= (const Matrix3x3 &mM) |
Matrix3x3 | operator- () const |
Matrix3x3 | operator- (const Matrix3x3 &mM) const |
void | operator-= (const Matrix3x3 &mM) |
Matrix3x3 | operator* (float fS) const |
void | operator*= (float fS) |
Vector2 | operator* (const Vector2 &vV) const |
Vector3 | operator* (const Vector3 &vV) const |
PLMATH_API Vector4 | operator* (const Vector4 &vV) const |
PLMATH_API Matrix3x3 | operator* (const Matrix3x3 &mM) const |
void | operator*= (const Matrix3x3 &mM) |
Matrix3x3 | operator/ (float fS) const |
void | operator/= (float fS) |
float | operator[] (int nIndex) const |
float & | operator[] (int nIndex) |
float | operator() (PLCore::uint32 nRow=0, PLCore::uint32 nColumn=0) const |
float & | operator() (PLCore::uint32 nRow=0, PLCore::uint32 nColumn=0) |
operator float * () | |
operator const float * () const | |
bool | IsZero () const |
Returns whether or not this matrix is the zero matrix using an epsilon environment. | |
bool | IsTrueZero () const |
Returns whether or not this matrix is truly the zero matrix. | |
void | SetZero () |
Sets a zero matrix. | |
bool | IsIdentity () const |
Returns whether or not this matrix is the identity matrix using an epsilon environment. | |
bool | IsTrueIdentity () const |
Returns whether or not this matrix is truly the identity matrix. | |
void | SetIdentity () |
Sets an identity matrix. | |
void | Set (float fXX, float fXY, float fXZ, float fYX, float fYY, float fYZ, float fZX, float fZY, float fZZ) |
Sets the elements of the matrix. | |
Vector3 | GetRow (PLCore::uint8 nRow) const |
Returns a requested row. | |
void | SetRow (PLCore::uint8 nRow, const Vector3 &vRow) |
Sets a row. | |
Vector3 | GetColumn (PLCore::uint8 nColumn) const |
Returns a requested column. | |
void | SetColumn (PLCore::uint8 nColumn, const Vector3 &vColumn) |
Sets a column. | |
bool | IsSymmetric () const |
Returns true if the matrix is symmetric. | |
bool | IsOrthogonal () const |
Returns true if this matrix is orthogonal. | |
bool | IsRotationMatrix () const |
Returns true if this matrix is a rotation matrix. | |
float | GetTrace () const |
Returns the trace of the matrix. | |
float | GetDeterminant () const |
Returns the determinant of the matrix. | |
void | Transpose () |
Transpose this matrix. | |
Matrix3x3 | GetTransposed () const |
Returns the transposed matrix. | |
PLMATH_API bool | Invert () |
Inverts the matrix. | |
PLMATH_API Matrix3x3 | GetInverted () const |
Returns the inverse of the matrix. | |
PLMATH_API Vector3 | RotateVector (float fX, float fY, float fZ, bool bUniformScale=false) const |
Rotates a vector. | |
PLMATH_API Vector3 | RotateVector (const Vector3 &vV, bool bUniformScale=false) const |
Rotates a vector. | |
void | SetScaleMatrix (float fX, float fY, float fZ) |
Sets a scale matrix. | |
void | SetScaleMatrix (const Vector3 &vV) |
PLMATH_API void | GetScale (float &fX, float &fY, float &fZ) const |
Extracts the scale vector from the matrix as good as possible. | |
Vector3 | GetScale () const |
void | GetScale (float fV[]) const |
PLMATH_API void | FromEulerAngleX (float fAngleX) |
Sets an x axis rotation matrix by using one given Euler angle. | |
PLMATH_API void | FromEulerAngleY (float fAngleY) |
Sets an y axis rotation matrix by using one given Euler angle. | |
PLMATH_API void | FromEulerAngleZ (float fAngleZ) |
Sets an z axis rotation matrix by using one given Euler angle. | |
PLMATH_API void | ToAxisAngle (float &fX, float &fY, float &fZ, float &fAngle) const |
Returns a rotation matrix as a selected axis and angle. | |
PLMATH_API void | FromAxisAngle (float fX, float fY, float fZ, float fAngle) |
Sets a rotation matrix by using a selected axis and angle. | |
Vector3 | GetXAxis () const |
Returns the x (left) axis. | |
Vector3 | GetYAxis () const |
Returns the y (up) axis. | |
Vector3 | GetZAxis () const |
Returns the z (forward) axis. | |
PLMATH_API void | ToAxis (Vector3 &vX, Vector3 &vY, Vector3 &vZ) const |
Returns the three axis of a rotation matrix (not normalized) | |
PLMATH_API void | FromAxis (const Vector3 &vX, const Vector3 &vY, const Vector3 &vZ) |
Sets a rotation matrix by using three given axis. | |
PLMATH_API Matrix3x3 & | LookAt (const Vector3 &vEye, const Vector3 &vAt, const Vector3 &vUp) |
Builds a look-at matrix. | |
Matrix3x3 & | SetShearing (float fShearXY, float fShearXZ, float fShearYX, float fShearYZ, float fShearZX, float fShearZY) |
Sets a shearing matrix. | |
Public Attributes | |
union { | |
float fM [9] | |
One dimensional array representation. | |
struct { | |
float xx | |
float yx | |
float zx | |
float xy | |
float yy | |
float zy | |
float xz | |
float yz | |
float zz | |
} | |
Direct element representation. | |
struct { | |
float fM33 [3][3] | |
} | |
Two dimensional array representation. | |
}; | |
Some direct matrix accesses. | |
Static Public Attributes | |
static PLMATH_API const Matrix3x3 | Zero |
static PLMATH_API const Matrix3x3 | Identity |
3x3 matrix
PLMath::Matrix3x3::Matrix3x3 | ( | ) | [inline] |
Default constructor setting an identity matrix.
PLMath::Matrix3x3::Matrix3x3 | ( | const float | fS[] | ) | [inline] |
PLMath::Matrix3x3::Matrix3x3 | ( | const Matrix3x3 & | mM | ) | [inline] |
PLMATH_API PLMath::Matrix3x3::Matrix3x3 | ( | const Matrix3x4 & | mM | ) |
PLMATH_API PLMath::Matrix3x3::Matrix3x3 | ( | const Matrix4x4 & | mM | ) |
PLMath::Matrix3x3::Matrix3x3 | ( | float | fXX, |
float | fXY, | ||
float | fXZ, | ||
float | fYX, | ||
float | fYY, | ||
float | fYZ, | ||
float | fZX, | ||
float | fZY, | ||
float | fZZ | ||
) | [inline] |
PLMath::Matrix3x3::~Matrix3x3 | ( | ) | [inline] |
PLMATH_API bool PLMath::Matrix3x3::operator== | ( | const Matrix3x3 & | mM | ) | const |
PLMATH_API bool PLMath::Matrix3x3::operator!= | ( | const Matrix3x3 & | mM | ) | const |
PLMATH_API bool PLMath::Matrix3x3::CompareScale | ( | const Matrix3x3 & | mM, |
float | fEpsilon = Math::Epsilon |
||
) | const |
PLMATH_API bool PLMath::Matrix3x3::CompareRotation | ( | const Matrix3x3 & | mM, |
float | fEpsilon = Math::Epsilon |
||
) | const |
Matrix3x3 & PLMath::Matrix3x3::operator= | ( | const float | fS[] | ) | [inline] |
void PLMath::Matrix3x3::operator+= | ( | const Matrix3x3 & | mM | ) | [inline] |
Matrix3x3 PLMath::Matrix3x3::operator- | ( | ) | const [inline] |
void PLMath::Matrix3x3::operator-= | ( | const Matrix3x3 & | mM | ) | [inline] |
Matrix3x3 PLMath::Matrix3x3::operator* | ( | float | fS | ) | const [inline] |
void PLMath::Matrix3x3::operator*= | ( | float | fS | ) | [inline] |
void PLMath::Matrix3x3::operator*= | ( | const Matrix3x3 & | mM | ) | [inline] |
Matrix3x3 PLMath::Matrix3x3::operator/ | ( | float | fS | ) | const [inline] |
void PLMath::Matrix3x3::operator/= | ( | float | fS | ) | [inline] |
float PLMath::Matrix3x3::operator[] | ( | int | nIndex | ) | const [inline] |
float & PLMath::Matrix3x3::operator[] | ( | int | nIndex | ) | [inline] |
float PLMath::Matrix3x3::operator() | ( | PLCore::uint32 | nRow = 0 , |
PLCore::uint32 | nColumn = 0 |
||
) | const [inline] |
float & PLMath::Matrix3x3::operator() | ( | PLCore::uint32 | nRow = 0 , |
PLCore::uint32 | nColumn = 0 |
||
) | [inline] |
PLMath::Matrix3x3::operator float * | ( | ) | [inline] |
PLMath::Matrix3x3::operator const float * | ( | ) | const [inline] |
bool PLMath::Matrix3x3::IsZero | ( | ) | const [inline] |
Returns whether or not this matrix is the zero matrix using an epsilon environment.
bool PLMath::Matrix3x3::IsTrueZero | ( | ) | const [inline] |
Returns whether or not this matrix is truly the zero matrix.
void PLMath::Matrix3x3::SetZero | ( | ) | [inline] |
Sets a zero matrix.
| 0 0 0 | | 0 0 0 | | 0 0 0 |
bool PLMath::Matrix3x3::IsIdentity | ( | ) | const [inline] |
Returns whether or not this matrix is the identity matrix using an epsilon environment.
bool PLMath::Matrix3x3::IsTrueIdentity | ( | ) | const [inline] |
Returns whether or not this matrix is truly the identity matrix.
void PLMath::Matrix3x3::SetIdentity | ( | ) | [inline] |
Sets an identity matrix.
| 1 0 0 | | 0 1 0 | | 0 0 1 |
void PLMath::Matrix3x3::Set | ( | float | fXX, |
float | fXY, | ||
float | fXZ, | ||
float | fYX, | ||
float | fYY, | ||
float | fYZ, | ||
float | fZX, | ||
float | fZY, | ||
float | fZZ | ||
) | [inline] |
Sets the elements of the matrix.
Vector3 PLMath::Matrix3x3::GetRow | ( | PLCore::uint8 | nRow | ) | const [inline] |
Returns a requested row.
[in] | nRow | Index of the row to return (0-2) |
| x y z | <- Row 0 | 0 0 0 | | 0 0 0 |
void PLMath::Matrix3x3::SetRow | ( | PLCore::uint8 | nRow, |
const Vector3 & | vRow | ||
) | [inline] |
Vector3 PLMath::Matrix3x3::GetColumn | ( | PLCore::uint8 | nColumn | ) | const [inline] |
Returns a requested column.
[in] | nColumn | Index of the column to return (0-2) |
| x 0 0 | | y 0 0 | | z 0 0 | ^ | Column 0
void PLMath::Matrix3x3::SetColumn | ( | PLCore::uint8 | nColumn, |
const Vector3 & | vColumn | ||
) | [inline] |
Sets a column.
[in] | nColumn | Index of the column to set (0-2) |
[in] | vColumn | Column vector |
bool PLMath::Matrix3x3::IsSymmetric | ( | ) | const [inline] |
Returns true if the matrix is symmetric.
bool PLMath::Matrix3x3::IsOrthogonal | ( | ) | const [inline] |
Returns true if this matrix is orthogonal.
bool PLMath::Matrix3x3::IsRotationMatrix | ( | ) | const [inline] |
Returns true if this matrix is a rotation matrix.
float PLMath::Matrix3x3::GetTrace | ( | ) | const [inline] |
Returns the trace of the matrix.
float PLMath::Matrix3x3::GetDeterminant | ( | ) | const [inline] |
Returns the determinant of the matrix.
void PLMath::Matrix3x3::Transpose | ( | ) | [inline] |
Transpose this matrix.
M' = M ij ji | xx xy xz | | xx yx zx | | yx yy yz | the transpose is | xy yy zy | | zx zy zz | | xz yz zz |
Matrix3x3 PLMath::Matrix3x3::GetTransposed | ( | ) | const [inline] |
PLMATH_API bool PLMath::Matrix3x3::Invert | ( | ) |
Inverts the matrix.
PLMATH_API Matrix3x3 PLMath::Matrix3x3::GetInverted | ( | ) | const |
Returns the inverse of the matrix.
PLMATH_API Vector3 PLMath::Matrix3x3::RotateVector | ( | float | fX, |
float | fY, | ||
float | fZ, | ||
bool | bUniformScale = false |
||
) | const |
Rotates a vector.
[in] | fX | X component of the vector to rotate |
[in] | fY | Y component of the vector to rotate |
[in] | fZ | Z component of the vector to rotate |
[in] | bUniformScale | Is this a uniform scale matrix? (all axis are scaled equally) If you know EXACTLY it's one, set this to 'true' to gain some more speed, else DON'T set to 'true'! |
PLMATH_API Vector3 PLMath::Matrix3x3::RotateVector | ( | const Vector3 & | vV, |
bool | bUniformScale = false |
||
) | const |
Rotates a vector.
[in] | vV | Vector to rotate |
[in] | bUniformScale | Is this a uniform scale matrix? (all axis are scaled equally) If you know EXACTLY it's one, set this to 'true' to gain some more speed, else DON'T set to 'true'! |
void PLMath::Matrix3x3::SetScaleMatrix | ( | float | fX, |
float | fY, | ||
float | fZ | ||
) | [inline] |
Sets a scale matrix.
[in] | fX | X scale |
[in] | fY | Y scale |
[in] | fZ | Z scale |
| x 0 0 | | 0 y 0 | | 0 0 z |
void PLMath::Matrix3x3::SetScaleMatrix | ( | const Vector3 & | vV | ) | [inline] |
PLMATH_API void PLMath::Matrix3x3::GetScale | ( | float & | fX, |
float & | fY, | ||
float & | fZ | ||
) | const |
Extracts the scale vector from the matrix as good as possible.
[out] | fX | Receives the x scale |
[out] | fY | Receives the y scale |
[out] | fZ | Receives the z scale |
Vector3 PLMath::Matrix3x3::GetScale | ( | ) | const [inline] |
void PLMath::Matrix3x3::GetScale | ( | float | fV[] | ) | const [inline] |
PLMATH_API void PLMath::Matrix3x3::FromEulerAngleX | ( | float | fAngleX | ) |
Sets an x axis rotation matrix by using one given Euler angle.
[in] | fAngleX | Rotation angle around the x axis (in radian, between [0, Math::Pi2]) |
| 1 0 0 | RX = | 0 cos(a) -sin(a) | | 0 sin(a) cos(a) |
PLMATH_API void PLMath::Matrix3x3::FromEulerAngleY | ( | float | fAngleY | ) |
Sets an y axis rotation matrix by using one given Euler angle.
[in] | fAngleY | Rotation angle around the y axis (in radian, between [0, Math::Pi2]) |
| cos(a) 0 sin(a) | RY = | 0 1 0 | | -sin(a) 0 cos(a) |
PLMATH_API void PLMath::Matrix3x3::FromEulerAngleZ | ( | float | fAngleZ | ) |
Sets an z axis rotation matrix by using one given Euler angle.
[in] | fAngleZ | Rotation angle around the z axis (in radian, between [0, Math::Pi2]) |
| cos(a) -sin(a) 0 | RZ = | sin(a) cos(a) 0 | | 0 0 1 |
PLMATH_API void PLMath::Matrix3x3::ToAxisAngle | ( | float & | fX, |
float & | fY, | ||
float & | fZ, | ||
float & | fAngle | ||
) | const |
Returns a rotation matrix as a selected axis and angle.
[out] | fX | Will receive the x component of the selected axis |
[out] | fY | Will receive the y component of the selected axis |
[out] | fZ | Will receive the z component of the selected axis |
[out] | fAngle | Will receive the rotation angle around the selected axis (in radian, between [0, Math::Pi]) |
PLMATH_API void PLMath::Matrix3x3::FromAxisAngle | ( | float | fX, |
float | fY, | ||
float | fZ, | ||
float | fAngle | ||
) |
Sets a rotation matrix by using a selected axis and angle.
[in] | fX | X component of the selected axis |
[in] | fY | Y component of the selected axis |
[in] | fZ | Z component of the selected axis |
[in] | fAngle | Rotation angle around the selected axis (in radian, between [0, Math::Pi]) |
Vector3 PLMath::Matrix3x3::GetXAxis | ( | ) | const [inline] |
Returns the x (left) axis.
| x 0 0 | | y 0 0 | | z 0 0 |
Vector3 PLMath::Matrix3x3::GetYAxis | ( | ) | const [inline] |
Returns the y (up) axis.
| 0 x 0 | | 0 y 0 | | 0 z 0 |
Vector3 PLMath::Matrix3x3::GetZAxis | ( | ) | const [inline] |
Returns the z (forward) axis.
| 0 0 x | | 0 0 y | | 0 0 z |
PLMATH_API void PLMath::Matrix3x3::ToAxis | ( | Vector3 & | vX, |
Vector3 & | vY, | ||
Vector3 & | vZ | ||
) | const |
Returns the three axis of a rotation matrix (not normalized)
[out] | vX | Will receive the x axis |
[out] | vY | Will receive the y axis |
[out] | vZ | Will receive the z axis |
| vX.x vY.x vZ.x | | vX.y vY.y vZ.y | | vX.z vY.z vZ.z |
PLMATH_API void PLMath::Matrix3x3::FromAxis | ( | const Vector3 & | vX, |
const Vector3 & | vY, | ||
const Vector3 & | vZ | ||
) |
Sets a rotation matrix by using three given axis.
[in] | vX | X axis |
[in] | vY | Y axis |
[in] | vZ | Z axis |
PLMATH_API Matrix3x3& PLMath::Matrix3x3::LookAt | ( | const Vector3 & | vEye, |
const Vector3 & | vAt, | ||
const Vector3 & | vUp | ||
) |
Builds a look-at matrix.
[in] | vEye | Eye position |
[in] | vAt | Camera look-at target |
[in] | vUp | Current world's up, usually [0, 1, 0] |
Matrix3x3 & PLMath::Matrix3x3::SetShearing | ( | float | fShearXY, |
float | fShearXZ, | ||
float | fShearYX, | ||
float | fShearYZ, | ||
float | fShearZX, | ||
float | fShearZY | ||
) | [inline] |
Sets a shearing matrix.
[in] | fShearXY | Shear X by Y |
[in] | fShearXZ | Shear X by Z |
[in] | fShearYX | Shear Y by X |
[in] | fShearYZ | Shear Y by Z |
[in] | fShearZX | Shear Z by X |
[in] | fShearZY | Shear Z by Y |
| 1 fShearYX fShearZX | | fShearXY 1 fShearZY | | fShearXZ fShearYZ 1 |
PLMATH_API const Matrix3x3 PLMath::Matrix3x3::Zero [static] |
Zero matrix
PLMATH_API const Matrix3x3 PLMath::Matrix3x3::Identity [static] |
Identity matrix
float PLMath::Matrix3x3::fM[9] |
One dimensional array representation.
| 0 3 6 | | 1 4 7 | | 2 5 8 |
float PLMath::Matrix3x3::xx |
float PLMath::Matrix3x3::yx |
float PLMath::Matrix3x3::zx |
float PLMath::Matrix3x3::xy |
float PLMath::Matrix3x3::yy |
float PLMath::Matrix3x3::zy |
float PLMath::Matrix3x3::xz |
float PLMath::Matrix3x3::yz |
float PLMath::Matrix3x3::zz |
float PLMath::Matrix3x3::fM33[3][3] |
union { ... } |
Some direct matrix accesses.
|