The Matrix struct represents a transformation matrix. More...
Public Member Functions | |
boolean | equals (Matrix other) |
Compare Matrix equality component-wise. More... | |
Vector | getOrigin () |
The translation factors for all three axes. More... | |
Vector | getXBasis () |
The basis vector for the x-axis. More... | |
Vector | getYBasis () |
The basis vector for the y-axis. More... | |
Vector | getZBasis () |
The basis vector for the z-axis. More... | |
Matrix () | |
Constructs an identity transformation matrix. More... | |
Matrix (Matrix other) | |
Constructs a copy of the specified Matrix object. More... | |
Matrix (Vector _xBasis, Vector _yBasis, Vector _zBasis) | |
Constructs a transformation matrix from the specified basis vectors. More... | |
Matrix (Vector _xBasis, Vector _yBasis, Vector _zBasis, Vector _origin) | |
Constructs a transformation matrix from the specified basis and translation vectors. More... | |
Matrix (Vector axis, float angleRadians) | |
Constructs a transformation matrix specifying a rotation around the specified vector. More... | |
Matrix (Vector axis, float angleRadians, Vector translation) | |
Constructs a transformation matrix specifying a rotation around the specified vector and a translation by the specified vector. More... | |
Matrix | rigidInverse () |
Performs a matrix inverse if the matrix consists entirely of rigid transformations (translations and rotations). More... | |
void | setOrigin (Vector value) |
The translation factors for all three axes. More... | |
void | setRotation (Vector axis, float angleRadians) |
Sets this transformation matrix to represent a rotation around the specified vector. More... | |
void | setXBasis (Vector value) |
The basis vector for the x-axis. More... | |
void | setYBasis (Vector value) |
The basis vector for the y-axis. More... | |
void | setZBasis (Vector value) |
The basis vector for the z-axis. More... | |
Matrix | times (Matrix other) |
Multiply transform matrices. More... | |
String | toString () |
Write the matrix to a string in a human readable format. More... | |
Vector | transformDirection (Vector in) |
Transforms a vector with this matrix by transforming its rotation and scale only. More... | |
Vector | transformPoint (Vector in) |
Transforms a vector with this matrix by transforming its rotation, scale, and translation. More... | |
Static Public Member Functions | |
static Matrix | identity () |
Returns the identity matrix specifying no translation, rotation, and scale. More... | |
The Matrix struct represents a transformation matrix.
To use this struct to transform a Vector, construct a matrix containing the desired transformation and then use the Matrix::transformPoint() or Matrix::transformDirection() functions to apply the transform.
Transforms can be combined by multiplying two or more transform matrices using the * operator.
Constructs a transformation matrix from the specified basis vectors.
_xBasis | A Vector specifying rotation and scale factors for the x-axis. |
_yBasis | A Vector specifying rotation and scale factors for the y-axis. |
_zBasis | A Vector specifying rotation and scale factors for the z-axis. |
Constructs a transformation matrix from the specified basis and translation vectors.
_xBasis | A Vector specifying rotation and scale factors for the x-axis. |
_yBasis | A Vector specifying rotation and scale factors for the y-axis. |
_zBasis | A Vector specifying rotation and scale factors for the z-axis. |
_origin | A Vector specifying translation factors on all three axes. |
Constructs a transformation matrix specifying a rotation around the specified vector.
axis | A Vector specifying the axis of rotation. |
angleRadians | The amount of rotation in radians. |
Constructs a transformation matrix specifying a rotation around the specified vector and a translation by the specified vector.
axis | A Vector specifying the axis of rotation. |
angleRadians | The angle of rotation in radians. |
translation | A Vector representing the translation part of the transform. |
boolean equals | ( | Matrix | other | ) |
Vector getOrigin | ( | ) |
The translation factors for all three axes.
Vector getXBasis | ( | ) |
The basis vector for the x-axis.
Vector getYBasis | ( | ) |
The basis vector for the y-axis.
Vector getZBasis | ( | ) |
The basis vector for the z-axis.
|
static |
Matrix rigidInverse | ( | ) |
Performs a matrix inverse if the matrix consists entirely of rigid transformations (translations and rotations).
If the matrix is not rigid, this operation will not represent an inverse.
Note that all matrices that are directly returned by the API are rigid.
void setOrigin | ( | Vector | value | ) |
The translation factors for all three axes.
void setRotation | ( | Vector | axis, |
float | angleRadians | ||
) |
Sets this transformation matrix to represent a rotation around the specified vector.
This function erases any previous rotation and scale transforms applied to this matrix, but does not affect translation.
axis | A Vector specifying the axis of rotation. |
angleRadians | The amount of rotation in radians. |
void setXBasis | ( | Vector | value | ) |
The basis vector for the x-axis.
void setYBasis | ( | Vector | value | ) |
The basis vector for the y-axis.
void setZBasis | ( | Vector | value | ) |
The basis vector for the z-axis.
Multiply transform matrices.
Combines two transformations into a single equivalent transformation.
other | A Matrix to multiply on the right hand side. |
String toString | ( | ) |
Write the matrix to a string in a human readable format.
Transforms a vector with this matrix by transforming its rotation, scale, and translation.
Translation is applied after rotation and scale.
in | The Vector to transform. |