#include <glmatrix.h>
It uses the (unfortutate) OpenGL layout:
( m[0] m[4] m[8] m[12] ) ( v[0])
| m[1] m[5] m[9] m[13] | | v[1]|
M(v) = | m[2] m[6] m[10] m[14] | x | v[2]|
( m[3] m[7] m[11] m[15] ) ( v[3])
Public Member Functions | |
| Matrix4 () | |
| Construct an identity matrix. | |
| void | SetIdentity () |
| Set the matrix to identity. | |
| void | SetTranslation (float _x, float _y, float _z) |
| Set the translation terms. | |
| void | SetTranslation (const Vector3F &vec) |
| Set the translation terms. | |
| void | SetXRotation (float thetaDegree) |
| Set the rotation terms. | |
| void | SetYRotation (float thetaDegree) |
| Set the rotation terms. | |
| void | SetZRotation (float thetaDegree) |
| Set the rotation terms. | |
| float | CalcRotationAroundAxis (int axis) const |
| Get the rotation around the X(0), Y(1), or Z(2) axis. | |
| void | SetScale (float scale) |
| Set the scale terms. | |
| void | SetAxisAngle (const Vector3F &axis, float angle) |
| Set the matrix from an axis-angle representation. | |
| bool | IsRotation () const |
| Is this probably a rotation matrix? | |
| void | Row (unsigned i, Vector3F *row) const |
| Return a row of the matrix. | |
| void | Col (unsigned i, Vector3F *col) const |
| Return a column of the matrix. | |
| void | Transpose (Matrix4 *transpose) const |
| Transpose. | |
| float | Determinant () const |
| Determinant. | |
| void | Adjoint (Matrix4 *adjoint) const |
| Adjoint. | |
| void | Invert (Matrix4 *inverse) const |
| Invert. | |
| void | Cofactor (Matrix4 *cofactor) const |
| Cofactor. | |
| void | ApplyScalar (float v) |
| Multiply all the terms of the matrix. | |
Friends | |
| void | MultMatrix4 (const Matrix4 &a, const Matrix4 &b, Matrix4 *c) |
| void | MultMatrix4 (const Matrix4 &a, const Vector3F &b, Vector3F *c) |
C = AB. Perform the operation in column-major form, meaning a vector as a columns. Note the target parameter is the last parameter, although it is more comfortable expressed: C = AB
| void MultMatrix4 | ( | const Matrix4 & | a, | |
| const Vector3F & | b, | |||
| Vector3F * | c | |||
| ) | [friend] |
w = Mv. Multiply a vector by a matrix. A vector is a column in column-major form.
1.5.1-p1