shz_mat4x4_inverse_block_triangular
void shz_mat4x4_inverse_block_triangular(const shz_mat4x4_t* mtx, shz_mat4x4_t* out) SHZ_NOEXCEPT;Computes the inverse of a 4x4 matrix in block-triangular form.
Parameters
Section titled “Parameters”| Name | Type | Description |
|---|---|---|
mtx | const shz_mat4x4_t * | |
out | shz_mat4x4_t * |
Returns
Section titled “Returns”Nothing (void).
Details
Section titled “Details”This is a special-case faster optimization for 4x4 matrices which take the form:
A = [ M b ] [ 0 w ]Where A is 4x4, M is 3x3, b is 3x1, and the bottom row is (0, 0, 0, w) with w != 0. For this block-triangular form, det(A) = det(M) * w. Then
inv(A) = [ inv(M) -inv(M) * b / w ] [ 0 1/w ]- A regular 3D transform matrix is already in this form.
shz_mat4x4_inverse()will dynamically check whether to use this optimization.
Naming and requirements
Section titled “Naming and requirements”shz_mat4x4_tandshz_mat2x2_targuments must be 8-byte aligned. Unaligned data goes through thefloat[16]parameters of the_unalignedroutines.
Availability
Section titled “Availability”- C++ equivalent:
shz::mat4x4::inverse_block_triangular - Type-generic form: none
- Back-ends: SH4: shared C implementation · SW: portable C · SPU: shared C implementation
- Defined in:
sh4zam/shz_matrix.h:844 - Module: Matrix, section "Miscellaneous"