In-Memory Matrix Manipulation.
These types and their corresponding functions are for working with matrices stored within memory, as opposed to being preloaded within the XMTRX back-bank of FP registers. Typically this is desirable for one-off operations where there is no batching of matrix operations, especially when clobbering XMTRX is undesirable.
For most transform types, this API offers 4 different "versions" of the operation. Using translation as an example:
- shz_mat4x4_init_translation(): Initializes the the matrix to a given transform, setting the other components to identity.
- shz_mat4x4_set_translation(): Sets only the values corresponding to the given transform, leaving the others alone.
- shz_mat4x4_apply_translation(): Apply transform operation, updates only the values corresponding to the given transform based on their current values (additively in this case, multiplicatively for scaling and rotation).
- shz_mat4x4_translate(): GL-based transform operation, multiplying and accumulating the given matrix by a matrix which has been initialized to the given transform.
- Warning
- Beware that some of these routines clobber the matrix currently loaded as the active 4x4 matrix, XMTRX.
- See also
- XMTRX