diff --git a/src/matrix.rs b/src/matrix.rs index 9d3acdf8..bf0a959c 100644 --- a/src/matrix.rs +++ b/src/matrix.rs @@ -299,6 +299,18 @@ impl Matrix4 { S::zero(), S::one()) } + + /// Create a matrix which flips the y and z coordnates. + /// + /// This is used to transform from a y-up coordinate system to + /// a z-up coordinate systems. + #[inline] + pub fn flip_y_up_to_z_up() -> Matrix4 { + Matrix4::new(S::one(), S::zero(), S::zero(), S::zero(), + S::zero(), S::zero(), S::one(), S::zero(), + S::zero(), -S::one(), S::zero(), S::zero(), + S::zero(), S::zero(), S::zero(), S::one()) + } } impl Zero for Matrix2 {