Removed some useless references.
This commit is contained in:
parent
870f4b804b
commit
edc5bb616d
|
@ -19,8 +19,8 @@ pub struct Transform<M, V>
|
|||
impl<M: Copy, V: Copy> Transform<M, V>
|
||||
{
|
||||
#[inline(always)]
|
||||
pub fn new(mat: &M, trans: &V) -> Transform<M, V>
|
||||
{ Transform { submat: copy *mat, subtrans: copy *trans } }
|
||||
pub fn new(mat: M, trans: V) -> Transform<M, V>
|
||||
{ Transform { submat: mat, subtrans: trans } }
|
||||
}
|
||||
|
||||
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)]
|
||||
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)]
|
||||
fn translate(&mut self, t: &V)
|
||||
|
@ -101,7 +101,7 @@ Rotation<AV> for Transform<M, V>
|
|||
// FIXME: this does not seem opitmal
|
||||
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)]
|
||||
|
@ -175,5 +175,5 @@ impl<M: Rand + Copy, V: Rand + Copy> Rand for Transform<M, V>
|
|||
{
|
||||
#[inline(always)]
|
||||
fn rand<R: Rng>(rng: &mut R) -> Transform<M, V>
|
||||
{ Transform::new(&rng.gen(), &rng.gen()) }
|
||||
{ Transform::new(rng.gen(), rng.gen()) }
|
||||
}
|
||||
|
|
|
@ -4,17 +4,17 @@
|
|||
pub trait Norm<N>
|
||||
{
|
||||
/// 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
|
||||
* norm itself.
|
||||
*/
|
||||
fn sqnorm(&self) -> N;
|
||||
fn sqnorm(&self) -> N;
|
||||
|
||||
/// Gets the normalized version of the argument.
|
||||
fn normalized(&self) -> Self;
|
||||
|
||||
/// In-place version of `normalized`.
|
||||
fn normalize(&mut self) -> N;
|
||||
fn normalize(&mut self) -> N;
|
||||
}
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue