A simple, OpenGL like, transform stack, with some optimization hints for dealing with orthonormal matrices. More...
Public Member Functions | |
MatrixStack (uint capacity) | |
MatrixStack constructor. | |
void | Push () |
Push matrix pushes a copy of current top matrix. | |
void | Pop () |
Pop the top matrix. | |
void | Mul (Matrix4 mat) |
Right multiply top matrix by 'mat'. | |
void | Mul1 (Matrix4 mat) |
Right Multiply top matrix by an orthonormal matrix 'mat'. | |
void | Set (Matrix4 mat) |
Set the current matrix (top of the matrix stack). | |
void | Set1 (Matrix4 mat) |
Set an orthonormal matrix. | |
Matrix4 | Get () |
Get the current matrix (top of the matrix stack). | |
Matrix4 | GetInverse () |
Update (if necessary) and return the cached inverse matrix. | |
void | SetIdentity () |
Set the top matrix to identity. | |
void | RotateX (float angle) |
Rotate the top matrix around X axis. | |
void | RotateY (float angle) |
Rotate the top matrix around Y axis. | |
void | RotateZ (float angle) |
Rotate the top matrix around Z axis. | |
void | Rotate (Vector3 axis, float angle) |
Rotate the top matrix around a user given axis. | |
void | Scale (Vector3 value) |
Scale the top matrix. | |
void | Translate (Vector3 value) |
Translate the top matrix. | |
Properties | |
uint | Tag [get] |
Tag is a number that gets incremented everytime the top matrix content changes. | |
uint | Size [get] |
Size of current stack. | |
uint | Capacity [get] |
Maximum stack size. |
A simple, OpenGL like, transform stack, with some optimization hints for dealing with orthonormal matrices.
MatrixStack | ( | uint | capacity | ) |
MatrixStack constructor.
capacity | Maximum depth of the stack. |
void Mul1 | ( | Matrix4 | mat | ) |
Right Multiply top matrix by an orthonormal matrix 'mat'.
If you know that your matrix is orthonormal, you can use Mul1 instead of Mul. As long as you keep operating on orthonormal matrices, inverse calculations will be faster.
void Set1 | ( | Matrix4 | mat | ) |
Set an orthonormal matrix.
If you know that your matrix is orthonormal, you can use Set1 instead of Set. As long as you keep operating on orthonormal matrices, inverse calculations will be faster.