Struct nalgebra::UnitQuat [] [src]

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

A unit quaternion that can represent a 3D rotation.

Methods

impl<N: BaseFloat> UnitQuat<N>

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

Creates a new unit quaternion from the axis-angle representation of a rotation.

fn new_with_quat(q: Quat<N>) -> UnitQuat<N>

Creates a new unit quaternion from a quaternion.

The input quaternion will be normalized.

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

Creates a new unit quaternion from Euler angles.

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

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

Builds a rotation matrix from this quaternion.

impl<N> UnitQuat<N>

unsafe fn new_with_unit_quat(q: Quat<N>) -> UnitQuat<N>

Creates a new unit quaternion from a quaternion.

This is unsafe because the input quaternion will not be normalized.

fn quat<'a>(&'a self) -> &'a Quat<N>

The Quat representation of this unit quaternion.

Trait Implementations

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

fn one() -> UnitQuat<N>

impl<N: Copy + Neg<Output=N>> Inv for UnitQuat<N>

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

fn inv_mut(&mut self) -> bool

impl<N: Rand + BaseFloat> Rand for UnitQuat<N>

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

impl<N: ApproxEq<N>> ApproxEq<N> for UnitQuat<N>

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

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

fn approx_eq_eps(&self, other: &UnitQuat<N>, eps: &N) -> bool

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

fn approx_eq(&self, other: &Self) -> bool

impl<N: BaseFloat + ApproxEq<N>> Div<UnitQuat<N>> for UnitQuat<N>

type Output = UnitQuat<N>

fn div(self, other: UnitQuat<N>) -> UnitQuat<N>

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

type Output = UnitQuat<N>

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

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

type Output = Vec3<N>

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

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

type Output = Pnt3<N>

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

impl<N: BaseFloat> Rotation<Vec3<N>> for UnitQuat<N>

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

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

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

fn append_rotation(&self, amount: &Vec3<N>) -> UnitQuat<N>

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

fn prepend_rotation(&self, amount: &Vec3<N>) -> UnitQuat<N>

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

impl<N: BaseNum + Neg<Output=N>> Rotate<Vec3<N>> for UnitQuat<N>

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

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

impl<N: BaseNum + Neg<Output=N>> Rotate<Pnt3<N>> for UnitQuat<N>

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

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

impl<N: BaseFloat + ApproxEq<N>> RotationTo for UnitQuat<N>

type AngleType = N

type DeltaRotationType = UnitQuat<N>

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

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

impl<N: BaseNum + Neg<Output=N>> Transform<Vec3<N>> for UnitQuat<N>

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

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

impl<N: BaseNum + Neg<Output=N>> Transform<Pnt3<N>> for UnitQuat<N>

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

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

impl<N> Dim for UnitQuat<N>

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

Derived Implementations

impl<N: Copy> Copy for UnitQuat<N>

impl<N: Debug> Debug for UnitQuat<N>

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

impl<N: Hash> Hash for UnitQuat<N>

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

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

impl<N: Clone> Clone for UnitQuat<N>

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

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

impl<N: Decodable> Decodable for UnitQuat<N>

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

impl<N: Encodable> Encodable for UnitQuat<N>

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

impl<N: PartialEq> PartialEq for UnitQuat<N>

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

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

impl<N: Eq> Eq for UnitQuat<N>