diff --git a/src/base/cg.rs b/src/base/cg.rs index 01be4e99..2a97607e 100644 --- a/src/base/cg.rs +++ b/src/base/cg.rs @@ -314,11 +314,12 @@ impl> SquareMatrix } } -impl> Transformation>> for MatrixN +impl, S: Storage> SquareMatrix where DefaultAllocator: Allocator + Allocator> + Allocator, DimNameDiff> { + /// Transforms the given vector, assuming the matirx `self` uses homogeneous coordinates. #[inline] fn transform_vector( &self, @@ -336,6 +337,7 @@ where DefaultAllocator: Allocator transform * v } + /// Transforms the given point, assuming the matrix `self` uses homogeneous coordinates. #[inline] fn transform_point(&self, pt: &Point>) -> Point> { let transform = self.fixed_slice::, DimNameDiff>(0, 0); @@ -351,3 +353,23 @@ where DefaultAllocator: Allocator transform * pt + translation } } + +impl> Transformation>> for MatrixN +where DefaultAllocator: Allocator + + Allocator> + + Allocator, DimNameDiff> +{ + #[inline] + fn transform_vector( + &self, + v: &VectorN>, + ) -> VectorN> + { + self.transform_vector(v) + } + + #[inline] + fn transform_point(&self, pt: &Point>) -> Point> { + self.transform_point(pt) + } +}