Struct nalgebra::Rot3 [] [src]

pub struct Rot3<N> {
    // some fields omitted
}

Three dimensional rotation matrix.

Methods

impl<N: Clone + BaseFloat> Rot3<N>

fn new(axisangle: Vec3<N>) -> Rot3<N>

Builds a 3 dimensional rotation matrix from an axis and an angle.

Arguments

  • axisangle - A vector representing the rotation. Its magnitude is the amount of rotation in radian. Its direction is the axis of rotation.

unsafe fn new_with_mat(mat: Mat3<N>) -> Rot3<N>

Builds a rotation matrix from an orthogonal matrix.

This is unsafe because the orthogonality of mat is not checked.

fn new_with_euler_angles(roll: N, pitch: N, yaw: N) -> Rot3<N>

Creates a new rotation from Euler angles.

The primitive rotations are applied in order: 1 roll − 2 pitch − 3 yaw.

impl<N: Clone + BaseFloat> Rot3<N>

fn look_at(at: &Vec3<N>, up: &Vec3<N>) -> Rot3<N>

Create a new matrix and orient it such that its local x axis points to a given point. Note that the usually known look_at function does the same thing but with the z axis. See look_at_z for that.

Arguments

  • at - The point to look at. It is also the direction the matrix x 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(at: &Vec3<N>, up: &Vec3<N>) -> Rot3<N>

Create a new matrix and orient it such that its local z axis points to a given point.

Arguments

  • at - The look direction, that is, direction the matrix y 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.

impl<N> Rot3<N>

fn submat<'r>(&'r self) -> &'r Mat3<N>

Trait Implementations

impl<N: Clone + BaseFloat + Cast<f64>> Rotation<Vec3<N>> for Rot3<N>

fn rotation(&self) -> Vec3<N>

fn inv_rotation(&self) -> Vec3<N>

fn append_rotation_mut(&mut self, rot: &Vec3<N>)

fn append_rotation(&self, axisangle: &Vec3<N>) -> Rot3<N>

fn prepend_rotation_mut(&mut self, rot: &Vec3<N>)

fn prepend_rotation(&self, axisangle: &Vec3<N>) -> Rot3<N>

fn set_rotation(&mut self, axisangle: Vec3<N>)

impl<N: BaseFloat> RotationTo for Rot3<N>

type AngleType = N

type DeltaRotationType = Rot3<N>

fn angle_to(&self, other: &Self) -> N

fn rotation_to(&self, other: &Self) -> Rot3<N>

impl<N: Clone + Rand + BaseFloat> Rand for Rot3<N>

fn rand<R: Rng>(rng: &mut R) -> Rot3<N>

impl<N: BaseFloat> AbsoluteRotate<Vec3<N>> for Rot3<N>

fn absolute_rotate(&self, v: &Vec3<N>) -> Vec3<N>

impl<N: BaseNum> Rotate<Vec3<N>> for Rot3<N>

fn rotate(&self, v: &Vec3<N>) -> Vec3<N>

fn inv_rotate(&self, v: &Vec3<N>) -> Vec3<N>

impl<N: BaseNum> Rotate<Pnt3<N>> for Rot3<N>

fn rotate(&self, p: &Pnt3<N>) -> Pnt3<N>

fn inv_rotate(&self, p: &Pnt3<N>) -> Pnt3<N>

impl<N: BaseNum> Transform<Vec3<N>> for Rot3<N>

fn transform(&self, v: &Vec3<N>) -> Vec3<N>

fn inv_transform(&self, v: &Vec3<N>) -> Vec3<N>

impl<N: BaseNum> Transform<Pnt3<N>> for Rot3<N>

fn transform(&self, p: &Pnt3<N>) -> Pnt3<N>

fn inv_transform(&self, p: &Pnt3<N>) -> Pnt3<N>

impl<N> Dim for Rot3<N>

fn dim(_: Option<Rot3<N>>) -> usize

impl<N: BaseNum> Mul<Rot3<N>> for Rot3<N>

type Output = Rot3<N>

fn mul(self, right: Rot3<N>) -> Rot3<N>

impl<N: BaseNum> Mul<Vec3<N>> for Rot3<N>

type Output = Vec3<N>

fn mul(self, right: Vec3<N>) -> Vec3<N>

impl<N: BaseNum> Mul<Pnt3<N>> for Rot3<N>

type Output = Pnt3<N>

fn mul(self, right: Pnt3<N>) -> Pnt3<N>

impl<N: BaseNum> One for Rot3<N>

fn one() -> Rot3<N>

impl<N: BaseNum> Eye for Rot3<N>

fn new_identity(dim: usize) -> Rot3<N>

impl<N: Zero + BaseNum + Cast<f64> + BaseFloat> RotationMatrix<N, Vec3<N>, Vec3<N>> for Rot3<N>

type Output = Rot3<N>

fn to_rot_mat(&self) -> Rot3<N>

impl<N: Copy + Zero> Col<Vec3<N>> for Rot3<N>

fn ncols(&self) -> usize

fn col(&self, i: usize) -> Vec3<N>

fn set_col(&mut self, i: usize, col: Vec3<N>)

impl<N: Copy + Zero> Row<Vec3<N>> for Rot3<N>

fn nrows(&self) -> usize

fn row(&self, i: usize) -> Vec3<N>

fn set_row(&mut self, i: usize, row: Vec3<N>)

impl<N> Index<(usize, usize)> for Rot3<N>

type Output = N

fn index(&self, i: (usize, usize)) -> &N

impl<N: Absolute<N>> Absolute<Mat3<N>> for Rot3<N>

fn abs(m: &Rot3<N>) -> Mat3<N>

impl<N: BaseNum> ToHomogeneous<Mat4<N>> for Rot3<N>

fn to_homogeneous(&self) -> Mat4<N>

impl<N: Copy> Inv for Rot3<N>

fn inv_mut(&mut self) -> bool

fn inv(&self) -> Option<Rot3<N>>

impl<N: Copy> Transpose for Rot3<N>

fn transpose(&self) -> Rot3<N>

fn transpose_mut(&mut self)

impl<N: ApproxEq<N>> ApproxEq<N> for Rot3<N>

fn approx_epsilon(_: Option<Rot3<N>>) -> N

fn approx_ulps(_: Option<Rot3<N>>) -> u32

fn approx_eq(&self, other: &Rot3<N>) -> bool

fn approx_eq_eps(&self, other: &Rot3<N>, epsilon: &N) -> bool

fn approx_eq_ulps(&self, other: &Rot3<N>, ulps: u32) -> bool

impl<N: Copy + Zero> Diag<Vec3<N>> for Rot3<N>

fn from_diag(diag: &Vec3<N>) -> Rot3<N>

fn diag(&self) -> Vec3<N>

Derived Implementations

impl<N: Copy> Copy for Rot3<N>

impl<N: Hash> Hash for Rot3<N>

fn hash<__H: Hasher>(&self, __arg_0: &mut __H)

fn hash_slice<H>(data: &[Self], state: &mut H) where H: Hasher

impl<N: Debug> Debug for Rot3<N>

fn fmt(&self, __arg_0: &mut Formatter) -> Result

impl<N: Clone> Clone for Rot3<N>

fn clone(&self) -> Rot3<N>

fn clone_from(&mut self, source: &Self)

impl<N: Decodable> Decodable for Rot3<N>

fn decode<__D: Decoder>(__arg_0: &mut __D) -> Result<Rot3<N>, __D::Error>

impl<N: Encodable> Encodable for Rot3<N>

fn encode<__S: Encoder>(&self, __arg_0: &mut __S) -> Result<(), __S::Error>

impl<N: PartialEq> PartialEq for Rot3<N>

fn eq(&self, __arg_0: &Rot3<N>) -> bool

fn ne(&self, __arg_0: &Rot3<N>) -> bool

impl<N: Eq> Eq for Rot3<N>