pub fn invert_trs<T: Copy + Float + NumAssign>(m: &mut Mat4<T>)
Expand description

Inverts a Mat4 that represents a valid transformation in TRS order (= translation * rotation * scale). This function is more efficient than Mat4::invert by leveraging the properties of a TRS matrix.

Examples

let mut m = <Mat4>::from_slice(&[2., 2., -1., 0., -2., 4., 4., 0., 6., -3., 6., 0., 1., 2., 3., 1.]);
transform::invert_trs(&mut m);
assert_float_eq!(m.as_ref(), &[2./9., -1./18., 2./27., 0., 2./9., 1./9., -1./27., 0., -1./9., 1./9., 2./27., 0., -1./3., -1./2., -2./9., 1.]);