Fix the implementation of `ToHomogeneous` for `Iso*`.

This commit is contained in:
Sébastien Crozet 2014-10-10 20:56:24 +02:00
parent 7e9bb98823
commit e852eb4783
2 changed files with 5 additions and 5 deletions

View File

@ -61,9 +61,9 @@ impl<N: Clone + Float> Iso3<N> {
/// aligned with. /// aligned with.
/// * up - Vector pointing up. The only requirement of this parameter is to not be colinear /// * up - Vector pointing up. The only requirement of this parameter is to not be colinear
/// with `at`. Non-colinearity is not checked. /// with `at`. Non-colinearity is not checked.
pub fn look_at(&mut self, eye: &Vec3<N>, at: &Vec3<N>, up: &Vec3<N>) { pub fn look_at(&mut self, eye: &Pnt3<N>, at: &Pnt3<N>, up: &Vec3<N>) {
self.rotation.look_at(&(*at - *eye), up); self.rotation.look_at(&(*at - *eye), up);
self.translation = eye.clone(); self.translation = eye.as_vec().clone();
} }
/// Reorient and translate this transformation such that its local `z` axis points to a given /// Reorient and translate this transformation such that its local `z` axis points to a given
@ -75,9 +75,9 @@ impl<N: Clone + Float> Iso3<N> {
/// aligned with /// aligned with
/// * up - Vector pointing `up`. The only requirement of this parameter is to not be colinear /// * up - Vector pointing `up`. The only requirement of this parameter is to not be colinear
/// with `at`. Non-colinearity is not checked. /// with `at`. Non-colinearity is not checked.
pub fn look_at_z(&mut self, eye: &Vec3<N>, at: &Vec3<N>, up: &Vec3<N>) { pub fn look_at_z(&mut self, eye: &Pnt3<N>, at: &Pnt3<N>, up: &Vec3<N>) {
self.rotation.look_at_z(&(*at - *eye), up); self.rotation.look_at_z(&(*at - *eye), up);
self.translation = eye.clone(); self.translation = eye.as_vec().clone();
} }
} }

View File

@ -358,7 +358,7 @@ macro_rules! to_homogeneous_impl(
// copy the translation // copy the translation
let dim = Dim::dim(None::<$th<N>>); let dim = Dim::dim(None::<$th<N>>);
res.set_col(dim - 1, ToHomogeneous::to_homogeneous(&m.translation)); res.set_col(dim - 1, ToHomogeneous::to_homogeneous(m.translation.as_pnt()).to_vec());
res res
} }