diff --git a/src/adaptors/transform.rs b/src/adaptors/transform.rs index e8fcab6e..b820a12e 100644 --- a/src/adaptors/transform.rs +++ b/src/adaptors/transform.rs @@ -72,16 +72,27 @@ impl> Translation for Transform { self.subtrans.translate(t) } } -impl + Copy, V: Copy> Rotation for Transform +impl + Copy + RMul + One, V: Copy> +Rotation for Transform { fn rotation(&self) -> V { self.submat.rotation() } fn rotated(&self, rot: &V) -> Transform - { transform(&self.submat.rotated(rot), &self.subtrans) } + { + // FIXME: this does not seem opitmal + let delta = One::one::().rotated(rot); + + transform(&self.submat.rotated(rot), &delta.rmul(&self.subtrans)) + } fn rotate(&mut self, rot: &V) - { self.submat.rotate(rot) } + { + // FIXME: this does not seem opitmal + let delta = One::one::().rotated(rot); + self.submat.rotate(rot); + self.subtrans = delta.rmul(&self.subtrans); + } } impl, V:Copy + Neg>