Struct nalgebra::Iso3
[−]
[src]
pub struct Iso3<N> { pub rotation: Rot3<N>, pub translation: Vec3<N>, }
Three dimensional isometry.
This is the composition of a rotation followed by a translation. Isometries conserve angles and distances, hence do not allow shearing nor scaling.
Fields
rotation | The rotation applicable by this isometry. |
translation | The translation applicable by this isometry. |
Methods
impl<N: Clone + BaseFloat> Iso3<N>
fn look_at(&mut self, eye: &Pnt3<N>, at: &Pnt3<N>, up: &Vec3<N>)
Reorient and translate this transformation such that its local x
axis points to a given
direction. Note that the usually known look_at
function does the same thing but with the
z
axis. See look_at_z
for that.
Arguments
- eye - The new translation of the transformation.
- at - The point to look at.
at - eye
is the direction the matrixx
axis will be aligned with. - up - Vector pointing up. The only requirement of this parameter is to not be colinear
with
at
. Non-colinearity is not checked.
fn look_at_z(&mut self, eye: &Pnt3<N>, at: &Pnt3<N>, up: &Vec3<N>)
Reorient and translate this transformation such that its local z
axis points to a given
direction.
Arguments
- eye - The new translation of the transformation.
- at - The point to look at.
at - eye
is the direction the matrixx
axis will be aligned with - up - Vector pointing
up
. The only requirement of this parameter is to not be colinear withat
. Non-colinearity is not checked.
impl<N: BaseFloat> Iso3<N>
fn new(translation: Vec3<N>, rotation: Vec3<N>) -> Iso3<N>
Creates a new isometry from a rotation matrix and a vector.
fn new_with_rotmat(translation: Vec3<N>, rotation: Rot3<N>) -> Iso3<N>
Creates a new isometry from a rotation matrix and a vector.