Polycode
|
4x4 Matrix. More...
Public Member Functions | |
Matrix4 (Number m00, Number m01, Number m02, Number m03, Number m10, Number m11, Number m12, Number m13, Number m20, Number m21, Number m22, Number m23, Number m30, Number m31, Number m32, Number m33) | |
Construct with 16 matrix values. | |
Matrix4 (const Number *m) | |
Construct with pointer to 16 Number values. | |
void | identity () |
Resets the matrix to identity. | |
Vector3 | rotateVector (const Vector3 &v2) const |
Rotates a vector by the matrix values. | |
Vector3 | getPosition () const |
Returns the position from the matrix. | |
void | setPosition (Number x, Number y, Number z) |
Sets the position in the matrix. | |
void | setScale (Vector3 scale) |
Sets the scale in the matrix. | |
void | getEulerAngles (Number *ax, Number *ay, Number *az) const |
Returns the matrix rotation as euler angles. | |
Matrix4 | transpose () const |
Returns the transpose of the matrix. | |
Matrix4 | inverse () const |
Returns the inverse of the matrix. | |
Matrix4 | inverseAffine () const |
Returns the affine inverse of the matrix. | |
Number | determinant () const |
Returns the determinant of the matrix. | |
Operators | |
Available vector operators. | |
Vector3 | operator* (const Vector3 &v2) const |
Number * | operator[] (int row) |
const Number * | operator[] (int row) const |
Matrix4 | operator+ (const Matrix4 &m2) const |
Matrix4 | operator* (const Matrix4 &m2) const |
Static Public Member Functions | |
static Number | generalDeterminant (Number const *const *a, int n) |
Returns the determinant of any general (square) matrix. |
4x4 Matrix.
Number Matrix4::generalDeterminant | ( | Number const *const * | a, |
int | n | ||
) | [static] |
Returns the determinant of any general (square) matrix.
a | A square matrix as an array of pointers to rows (or columns). |
n | The number of dimensions in matrix A. |
void Polycode::Matrix4::getEulerAngles | ( | Number * | ax, |
Number * | ay, | ||
Number * | az | ||
) | const [inline] |
Returns the matrix rotation as euler angles.
(This might be kind of buggy).
ax | Pointer to roll angle to set. |
ay | Pointer to pitch angle to set. |
az | Pointer to yaw angle to set. |
Vector3 Polycode::Matrix4::getPosition | ( | ) | const [inline] |
Returns the position from the matrix.
Rotates a vector by the matrix values.
v2 | Vector to rotate. |
void Polycode::Matrix4::setPosition | ( | Number | x, |
Number | y, | ||
Number | z | ||
) | [inline] |
Sets the position in the matrix.
x | X coordinate. |
y | Y coordinate. |
z | Z coordinate. |
void Polycode::Matrix4::setScale | ( | Vector3 | scale | ) | [inline] |
Sets the scale in the matrix.
x | X scale. |
y | Y scale. |
z | Z scale. |