Implement AbsoluteRotate for Identity.

This commit is contained in:
Sébastien Crozet 2013-11-28 20:11:10 +01:00
parent b244975f93
commit 930ff81f3b
1 changed files with 8 additions and 1 deletions

View File

@ -1,7 +1,7 @@
use std::num::{One, Zero}; use std::num::{One, Zero};
use structs::mat; use structs::mat;
use traits::operations::{Inv, Transpose}; use traits::operations::{Inv, Transpose};
use traits::geometry::{Translation, Translate, Rotation, Rotate, Transformation, Transform}; use traits::geometry::{Translation, Translate, Rotation, Rotate, Transformation, Transform, AbsoluteRotate};
impl One for mat::Identity { impl One for mat::Identity {
#[inline] #[inline]
@ -136,6 +136,13 @@ impl<V: Clone> Rotate<V> for mat::Identity {
} }
} }
impl<V: Clone> AbsoluteRotate<V> for mat::Identity {
#[inline]
fn absolute_rotate(&self, v: &V) -> V {
v.clone()
}
}
impl<M: One> Transformation<M> for mat::Identity { impl<M: One> Transformation<M> for mat::Identity {
#[inline] #[inline]
fn transformation(&self) -> M { fn transformation(&self) -> M {