diff --git a/src/structs/iso.rs b/src/structs/iso.rs index b8e6957e..f42d48d5 100644 --- a/src/structs/iso.rs +++ b/src/structs/iso.rs @@ -69,9 +69,8 @@ impl Iso3 { /// aligned with. /// * up - Vector pointing up. The only requirement of this parameter is to not be colinear /// with `at`. Non-colinearity is not checked. - pub fn look_at(&mut self, eye: &Pnt3, at: &Pnt3, up: &Vec3) { - self.rotation = Rot3::look_at(&(*at - *eye), up); - self.translation = eye.as_vec().clone(); + pub fn look_at(eye: &Pnt3, at: &Pnt3, up: &Vec3) -> Iso3 { + Iso3::new_with_rotmat(eye.as_vec().clone(), Rot3::look_at(&(*at - *eye), up)) } /// Reorient and translate this transformation such that its local `z` axis points to a given @@ -83,9 +82,8 @@ impl Iso3 { /// aligned with /// * up - Vector pointing `up`. The only requirement of this parameter is to not be colinear /// with `at`. Non-colinearity is not checked. - pub fn look_at_z(&mut self, eye: &Pnt3, at: &Pnt3, up: &Vec3) { - self.rotation = Rot3::look_at_z(&(*at - *eye), up); - self.translation = eye.as_vec().clone(); + pub fn look_at_z(eye: &Pnt3, at: &Pnt3, up: &Vec3) -> Iso3 { + Iso3::new_with_rotmat(eye.as_vec().clone(), Rot3::look_at_z(&(*at - *eye), up)) } }