Skip to content

shz_mat4x4_inverse_rigid

Markdown
SHZ_INLINE void shz_mat4x4_inverse_rigid(const shz_mat4x4_t* mtx, shz_mat4x4_t* out) SHZ_NOEXCEPT;

Computes the inverse of a rigid 4x4 transform matrix.

NameTypeDescription
mtxconst shz_mat4x4_t *
outshz_mat4x4_t *

Nothing (void).

mtx must be a rigid affine transform [R t; 0 1], where R is orthonormal. The result, [transpose(R), -transpose(R) * t; 0 1], is computed by transposing R rather than by a general inversion, making this far cheaper than shz_mat4x4_inverse().

  • shz_mat4x4_inverse() does not dynamically check whether to use this optimization.
  • Scale, shear, and projective matrices are not inverted correctly. Use shz_mat4x4_inverse() for those.
  • This routine clobbers XMTRX.
  • shz_mat4x4_t and shz_mat2x2_t arguments must be 8-byte aligned. Unaligned data goes through the float[16] parameters of the _unaligned routines.

shz_xmtrx_invert_rigid, shz_mat4x4_inverse_block_triangular