diff --git a/src/geometry/isometry_alga.rs b/src/geometry/isometry_alga.rs index 14b9a91f..ae601a4f 100644 --- a/src/geometry/isometry_alga.rs +++ b/src/geometry/isometry_alga.rs @@ -1,13 +1,13 @@ use alga::general::{AbstractGroup, AbstractLoop, AbstractMagma, AbstractMonoid, AbstractQuasigroup, AbstractSemigroup, Id, Identity, Inverse, Multiplicative, Real}; +use alga::linear::Isometry as AlgaIsometry; use alga::linear::{AffineTransformation, DirectIsometry, ProjectiveTransformation, Rotation, Similarity, Transformation}; -use alga::linear::Isometry as AlgaIsometry; -use core::{DefaultAllocator, VectorN}; -use core::dimension::DimName; use core::allocator::Allocator; +use core::dimension::DimName; +use core::{DefaultAllocator, VectorN}; use geometry::{Isometry, Point, Translation}; diff --git a/src/geometry/isometry_ops.rs b/src/geometry/isometry_ops.rs index 38a7f939..dced84dc 100644 --- a/src/geometry/isometry_ops.rs +++ b/src/geometry/isometry_ops.rs @@ -3,9 +3,9 @@ use std::ops::{Div, DivAssign, Mul, MulAssign}; use alga::general::Real; use alga::linear::Rotation as AlgaRotation; -use core::{DefaultAllocator, Unit, VectorN}; -use core::dimension::{DimName, U1, U3, U4}; use core::allocator::Allocator; +use core::dimension::{DimName, U1, U3, U4}; +use core::{DefaultAllocator, Unit, VectorN}; use geometry::{Isometry, Point, Rotation, Translation, UnitQuaternion}; @@ -281,16 +281,6 @@ isometry_binop_impl_all!( [ref ref] => Isometry::from_parts(self * &right.translation, right.rotation.clone()); ); -// Translation × R -isometry_binop_impl_all!( - Mul, mul; - self: Translation, right: R, Output = Isometry; - [val val] => Isometry::from_parts(self, right); - [ref val] => Isometry::from_parts(self.clone(), right); - [val ref] => Isometry::from_parts(self, right.clone()); - [ref ref] => Isometry::from_parts(self.clone(), right.clone()); -); - macro_rules! isometry_from_composition_impl( ($Op: ident, $op: ident; ($R1: ty, $C1: ty),($R2: ty, $C2: ty) $(for $Dims: ident: $DimsBound: ident),*; @@ -422,3 +412,25 @@ isometry_from_composition_impl_all!( [val ref] => self * right.inverse(); [ref ref] => self * right.inverse(); ); + +// Translation × Rotation +isometry_from_composition_impl_all!( + Mul, mul; + (D, D), (D, U1) for D: DimName; + self: Translation, right: Rotation, Output = Isometry>; + [val val] => Isometry::from_parts(self, right); + [ref val] => Isometry::from_parts(self.clone(), right); + [val ref] => Isometry::from_parts(self, right.clone()); + [ref ref] => Isometry::from_parts(self.clone(), right.clone()); +); + +// Translation × UnitQuaternion +isometry_from_composition_impl_all!( + Mul, mul; + (U4, U1), (U3, U1); + self: Translation, right: UnitQuaternion, Output = Isometry>; + [val val] => Isometry::from_parts(self, right); + [ref val] => Isometry::from_parts(self.clone(), right); + [val ref] => Isometry::from_parts(self, right.clone()); + [ref ref] => Isometry::from_parts(self.clone(), right.clone()); +); diff --git a/src/geometry/unit_complex_ops.rs b/src/geometry/unit_complex_ops.rs index d2cb9438..864cb5b8 100644 --- a/src/geometry/unit_complex_ops.rs +++ b/src/geometry/unit_complex_ops.rs @@ -1,11 +1,11 @@ use std::ops::{Div, DivAssign, Mul, MulAssign}; use alga::general::Real; -use core::{DefaultAllocator, Matrix, Unit, Vector, Vector2}; -use core::dimension::{Dim, U1, U2}; -use core::storage::{Storage, StorageMut}; use core::allocator::Allocator; use core::constraint::{DimEq, ShapeConstraint}; +use core::dimension::{Dim, U1, U2}; +use core::storage::{Storage, StorageMut}; +use core::{DefaultAllocator, Matrix, Unit, Vector, Vector2}; use geometry::{Isometry, Point2, Rotation, Similarity, Translation, UnitComplex}; /* @@ -288,6 +288,18 @@ complex_op_impl_all!( [ref ref] => Isometry::from_parts(Translation::from_vector( self * &rhs.vector), self.clone()); ); +// Translation × UnitComplex +complex_op_impl_all!( + Mul, mul; + (U2, U1); + self: Translation, right: UnitComplex, + Output = Isometry>; + [val val] => Isometry::from_parts(self, right); + [ref val] => Isometry::from_parts(self.clone(), right); + [val ref] => Isometry::from_parts(self, right.clone()); + [ref ref] => Isometry::from_parts(self.clone(), right.clone()); +); + // UnitComplex ×= UnitComplex impl MulAssign> for UnitComplex { #[inline]