Removed some useless references.

This commit is contained in:
Sébastien Crozet 2013-06-24 21:38:52 +00:00
parent 870f4b804b
commit edc5bb616d
3 changed files with 11 additions and 9 deletions

View File

@ -19,8 +19,8 @@ pub struct Transform<M, V>
impl<M: Copy, V: Copy> Transform<M, V> impl<M: Copy, V: Copy> Transform<M, V>
{ {
#[inline(always)] #[inline(always)]
pub fn new(mat: &M, trans: &V) -> Transform<M, V> pub fn new(mat: M, trans: V) -> Transform<M, V>
{ Transform { submat: copy *mat, subtrans: copy *trans } } { Transform { submat: mat, subtrans: trans } }
} }
impl<M:Dim, V> Dim for Transform<M, V> impl<M:Dim, V> Dim for Transform<M, V>
@ -81,7 +81,7 @@ impl<M: Copy, V: Copy + Translation<V>> Translation<V> for Transform<M, V>
#[inline(always)] #[inline(always)]
fn translated(&self, t: &V) -> Transform<M, V> fn translated(&self, t: &V) -> Transform<M, V>
{ Transform::new(&self.submat, &self.subtrans.translated(t)) } { Transform::new(copy self.submat, self.subtrans.translated(t)) }
#[inline(always)] #[inline(always)]
fn translate(&mut self, t: &V) fn translate(&mut self, t: &V)
@ -101,7 +101,7 @@ Rotation<AV> for Transform<M, V>
// FIXME: this does not seem opitmal // FIXME: this does not seem opitmal
let delta = One::one::<M>().rotated(rot); let delta = One::one::<M>().rotated(rot);
Transform::new(&self.submat.rotated(rot), &delta.rmul(&self.subtrans)) Transform::new(self.submat.rotated(rot), delta.rmul(&self.subtrans))
} }
#[inline(always)] #[inline(always)]
@ -175,5 +175,5 @@ impl<M: Rand + Copy, V: Rand + Copy> Rand for Transform<M, V>
{ {
#[inline(always)] #[inline(always)]
fn rand<R: Rng>(rng: &mut R) -> Transform<M, V> fn rand<R: Rng>(rng: &mut R) -> Transform<M, V>
{ Transform::new(&rng.gen(), &rng.gen()) } { Transform::new(rng.gen(), rng.gen()) }
} }

View File

@ -4,17 +4,17 @@
pub trait Norm<N> pub trait Norm<N>
{ {
/// Computes the norm a an object. /// Computes the norm a an object.
fn norm(&self) -> N; fn norm(&self) -> N;
/** /**
* Computes the squared norm of an object. Usually faster than computing the * Computes the squared norm of an object. Usually faster than computing the
* norm itself. * norm itself.
*/ */
fn sqnorm(&self) -> N; fn sqnorm(&self) -> N;
/// Gets the normalized version of the argument. /// Gets the normalized version of the argument.
fn normalized(&self) -> Self; fn normalized(&self) -> Self;
/// In-place version of `normalized`. /// In-place version of `normalized`.
fn normalize(&mut self) -> N; fn normalize(&mut self) -> N;
} }

View File

@ -1,4 +1,6 @@
pub trait SubDot<N> use traits::dot::Dot;
pub trait SubDot<N> : Sub<Self, Self> + Dot<N>
{ {
/** /**
* Short-cut to compute the projecton of a point on a vector, but without * Short-cut to compute the projecton of a point on a vector, but without