pub fn rotation_of<T: Copy + Float + NumAssign>(m: Mat4<T>) -> Quaternion<T>
Expand description

Extracts the rotation quaternion component from a 4x4 TRS transformation matrix.

Examples

assert_float_eq!(
    transform::rotation_of(<Mat4>::from_slice(&[2., 2., -1., 0., -2., 4., 4., 0., 6., -3., 6., 0., 11., 12., 13., 1.])).as_ref(),
    &[0.5/3_f32.sqrt(), 0.5/3_f32.sqrt(), 0.5/3_f32.sqrt(), 3_f32.sqrt()/2.]
);