diff --git a/src/geometry/isometry_ops.rs b/src/geometry/isometry_ops.rs index 02b89590..7cec960d 100644 --- a/src/geometry/isometry_ops.rs +++ b/src/geometry/isometry_ops.rs @@ -3,7 +3,7 @@ use std::ops::{Mul, MulAssign, Div, DivAssign}; use alga::general::Real; use alga::linear::Rotation as AlgaRotation; -use core::{DefaultAllocator, VectorN}; +use core::{DefaultAllocator, VectorN, Unit}; use core::dimension::{DimName, U1, U3, U4}; use core::allocator::Allocator; @@ -30,6 +30,7 @@ use geometry::{Point, Rotation, Isometry, Translation, UnitQuaternion}; * * Isometry × Point * Isometry × Vector + * Isometry × Unit * * * Isometry × Translation @@ -252,6 +253,18 @@ isometry_binop_impl_all!( [ref ref] => self.rotation.transform_vector(right); ); +// Isometry × Unit +isometry_binop_impl_all!( + Mul, mul; + // FIXME: because of `transform_vector`, we cant use a generic storage type for the rhs vector, + // i.e., right: Vector where S: Storage. + self: Isometry, right: Unit>, Output = Unit>; + [val val] => Unit::new_unchecked(self.rotation.transform_vector(right.as_ref())); + [ref val] => Unit::new_unchecked(self.rotation.transform_vector(right.as_ref())); + [val ref] => Unit::new_unchecked(self.rotation.transform_vector(right.as_ref())); + [ref ref] => Unit::new_unchecked(self.rotation.transform_vector(right.as_ref())); +); + // Isometry × Translation isometry_binop_impl_all!(