#include <math.h>
Public Member Functions | |
Matrix (void) | |
Construct a matrix without initializing its elements. The values stored in the matrix are undefined. More... | |
Matrix (const Matrix &m) | |
Matrix (float f11, float f12, float f13, float f14, float f21, float f22, float f23, float f24, float f31, float f32, float f33, float f34, float f41, float f42, float f43, float f44) | |
Construct the matrix by passing all the 16 values. More... | |
Matrix (const double *pMatrix) | |
Construct a matrix from an array of double values. At least 16 values should be contained in the array. More... | |
float & | operator() (int iRow, int iColumn) |
Returns a reference to a specific element in the matrix. More... | |
float | operator() (int iRow, int iColumn) const |
Returns the value of a specific element in the matrix. More... | |
operator const float * (void) const | |
Returns a pointer to the matrix data as a pointer to float values. More... | |
operator float * (void) | |
Returns a pointer to the constant matrix data as a pointer to float values. More... | |
Matrix & | SetIdentity (void) |
Sets this matrix to be the identity matrix. More... | |
bool | IsIdentity (void) const |
Return true if the matrix is the identity matrix. More... | |
bool | IsRigid (void) const |
Returns true if the transformation represented by the matrix is rigid (contains only translation and rotation, not scale). More... | |
Matrix & | operator*= (float) |
Multiplies the matrix with a scalar value. More... | |
Matrix | operator* (const Matrix &m) const |
Multiplies two matrices. More... | |
Matrix | operator* (float) const |
Returns the multiplication of a matrix and a scalar. More... | |
Matrix | operator+ (const Matrix &) const |
Returns the sum of two matrices. More... | |
Matrix & | operator*= (const Matrix &m) |
Multiplies the matrix with another matrix. More... | |
bool | operator== (const Matrix &m) const |
Return true if the two matrices are identical. More... | |
void | SetRow (int iRowIndex, const Vector &vValue) |
Sets the values in a row of the matrix. More... | |
Matrix & | Transpose (void) |
Transposes the matrix and returns it. More... | |
Matrix & | Invert (bool *pOk=0) |
Inverts the matrix and returns it. More... | |
Matrix & | FromEuler (const Vector &vAngles) |
Creates a rotation matrix from the given euler values stored in the vector and returns it. More... | |
Vector | ToEuler (void) const |
Converts a rotation matrix to euler values returns them in a vector. More... | |
Matrix & | FromAxisAngle (const Vector &vAxis, float fAngle) |
Calculates a rotation matrix from an axis and angle and returns it. More... | |
Vector | Transform (const Vector &v, float fW=1.0f) const |
Transforms a vector by the matrix and returns the result. More... | |
Vector | ProjectedTransform (const Vector &v, float fW=1.0f) const |
Transforms a point (represented by a Vector) by the matrix and returns the result. More... | |
Vector | Transform (const Vector &v, float fW, float &fRW) const |
Transforms a point (represented by a Vector) by the matrix, and returns all four homogeneous coordinates. More... | |
Vector | TransformDirection (const Vector &v) const |
Transform a direction vector by the matrix. More... | |
Public Attributes | |
union { | |
float m_fData [16] | |
struct { | |
float _11 | |
float _12 | |
float _13 | |
float _14 | |
float _21 | |
float _22 | |
float _23 | |
float _24 | |
float _31 | |
float _32 | |
float _33 | |
float _34 | |
float _41 | |
float _42 | |
float _43 | |
float _44 | |
} | |
double m_fAlignDummy [8] | |
__m128 m_vAlignDummy [4] | |
}; | |
|
inline |
Matrix | ( | const double * | pMatrix | ) |
Construct a matrix from an array of double values. At least 16 values should be contained in the array.
|
inline |
|
inline |
bool IsIdentity | ( | void | ) | const |
Return true if the matrix is the identity matrix.
bool IsRigid | ( | void | ) | const |
Returns true if the transformation represented by the matrix is rigid (contains only translation and rotation, not scale).
Matrix& operator*= | ( | float | ) |
Multiplies the matrix with a scalar value.
Matrix operator* | ( | float | ) | const |
Returns the multiplication of a matrix and a scalar.
bool operator== | ( | const Matrix & | m | ) | const |
Return true if the two matrices are identical.
Sets the values in a row of the matrix.
The last value in the row remains unchanged.
Matrix& Invert | ( | bool * | pOk = 0 | ) |
Inverts the matrix and returns it.
If pOk is not 0, it is set to true if the matrix inversion is successfull, otherwise it is set to false
Creates a rotation matrix from the given euler values stored in the vector and returns it.
Calculates a rotation matrix from an axis and angle and returns it.
Transforms a vector by the matrix and returns the result.
The fourth component of the vector (if you are using homogeneous coordinates) can be passed in the fW parameter.
[in] | v | A Vector containing the x, y, z components of the point |
[in] | fW | The w component of the point |
Definition at line 1219 of file math.h.
Transforms a point (represented by a Vector) by the matrix and returns the result.
This point is assumed to be represented in homogenous coordinates, with a fourth (W) value. After the transformation the result vector will be divided by the resulting W component.
[in] | v | A Vector containing the x, y, z components of the point |
[in] | fW | The w component of the point |
Definition at line 1234 of file math.h.
Transforms a point (represented by a Vector) by the matrix, and returns all four homogeneous coordinates.
Since Vectors only hold 3 coordinates, the W coordinate is passed in and out through parameters.
[in] | v | A Vector containing the x, y, z components of the point |
[in] | fW | The w component of the point |
[out] | fRW | The w component of the transformed point |
Definition at line 1252 of file math.h.
union { ... } |