diff --git a/src/geometry/transform.rs b/src/geometry/transform.rs index 8d311375..5ff2d85e 100644 --- a/src/geometry/transform.rs +++ b/src/geometry/transform.rs @@ -100,9 +100,10 @@ impl TCategory for TAffine { D: DimName, S: Storage, N::Epsilon: Copy { - mat.is_invertible() && - mat[(D::dim(), D::dim())] == N::one() && - (0 .. D::dim()).all(|i| mat[(D::dim(), i)].is_zero()) + let last = D::dim() - 1; + mat.is_invertible() && + mat[(last, last)] == N::one() && + (0 .. last).all(|i| mat[(last, i)].is_zero()) } } @@ -334,3 +335,15 @@ impl TransformBase self.matrix_mut_unchecked() } } + +#[cfg(test)] +mod tests { + use super::*; + use ::core::Matrix4; + + #[test] + fn checks_homogeneous_invariants_of_square_identity_matrix() { + assert!(TAffine::check_homogeneous_invariants(&Matrix4::::identity())); + } + +}