Function validate_transform

Source
pub fn validate_transform(model: Mat4) -> Result<(), DrawError>
Expand description

Check a finite affine model matrix and its inverse-transpose normal matrix. Uses only stack storage. Reflections, shear, and nonuniform scale are valid; projection belongs in the camera matrix. Does not evaluate shader arithmetic or guarantee that extreme finite vertex/transform products cannot overflow.

use ferravex_render::{Mat4, Vec3, retained::{validate_transform, DrawError}};
validate_transform(Mat4::from_scale(Vec3::new(-2., 3., 4.)))?;
assert_eq!(validate_transform(Mat4::from_scale(Vec3::ZERO)),
           Err(DrawError::NonInvertibleModel));