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>
[src]
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>
[src]
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: Copy> Copy for UnitQuat<N>
[src]
impl<N: Debug> Debug for UnitQuat<N>
[src]
impl<N: Hash> Hash for UnitQuat<N>
[src]
fn hash<__HN: Hasher>(&self, __arg_0: &mut __HN)
Feeds this value into the state given, updating the hasher as necessary.
fn hash_slice<H>(data: &[Self], state: &mut H) where H: Hasher
1.3.0
Feeds a slice of this type into the state provided.
impl<N: Clone> Clone for UnitQuat<N>
[src]
fn clone(&self) -> UnitQuat<N>
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0
Performs copy-assignment from source
. Read more
impl<N: Decodable> Decodable for UnitQuat<N>
[src]
impl<N: Encodable> Encodable for UnitQuat<N>
[src]
impl<N: PartialEq> PartialEq for UnitQuat<N>
[src]
fn eq(&self, __arg_0: &UnitQuat<N>) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, __arg_0: &UnitQuat<N>) -> bool
This method tests for !=
.
impl<N: Eq> Eq for UnitQuat<N>
[src]
impl<N: BaseNum> One for UnitQuat<N>
[src]
impl<N: Copy + Neg<Output=N>> Inv for UnitQuat<N>
[src]
fn inv(&self) -> Option<UnitQuat<N>>
Returns the inverse of m
.
fn inv_mut(&mut self) -> bool
In-place version of inverse
.
impl<N: Rand + BaseFloat> Rand for UnitQuat<N>
[src]
fn rand<R: Rng>(rng: &mut R) -> UnitQuat<N>
Generates a random instance of this type using the specified source of randomness. Read more
impl<N: ApproxEq<N>> ApproxEq<N> for UnitQuat<N>
[src]
fn approx_epsilon(_: Option<UnitQuat<N>>) -> N
Default epsilon for approximation.
fn approx_ulps(_: Option<UnitQuat<N>>) -> u32
Default ULPs for approximation.
fn approx_eq_eps(&self, other: &UnitQuat<N>, eps: &N) -> bool
Tests approximate equality using a custom epsilon.
fn approx_eq_ulps(&self, other: &UnitQuat<N>, ulps: u32) -> bool
Tests approximate equality using units in the last place (ULPs)
fn approx_eq(&self, other: &Self) -> bool
Tests approximate equality.
impl<N: BaseFloat + ApproxEq<N>> Div<UnitQuat<N>> for UnitQuat<N>
[src]
type Output = UnitQuat<N>
The resulting type after applying the /
operator
fn div(self, other: UnitQuat<N>) -> UnitQuat<N>
The method for the /
operator
impl<N: BaseNum> Mul<UnitQuat<N>> for UnitQuat<N>
[src]
type Output = UnitQuat<N>
The resulting type after applying the *
operator
fn mul(self, right: UnitQuat<N>) -> UnitQuat<N>
The method for the *
operator
impl<N: BaseNum> Mul<Vec3<N>> for UnitQuat<N>
[src]
type Output = Vec3<N>
The resulting type after applying the *
operator
fn mul(self, right: Vec3<N>) -> Vec3<N>
The method for the *
operator
impl<N: BaseNum> Mul<Pnt3<N>> for UnitQuat<N>
[src]
type Output = Pnt3<N>
The resulting type after applying the *
operator
fn mul(self, right: Pnt3<N>) -> Pnt3<N>
The method for the *
operator
impl<N: BaseFloat> Rotation<Vec3<N>> for UnitQuat<N>
[src]
fn rotation(&self) -> Vec3<N>
Gets the rotation associated with self
.
fn inv_rotation(&self) -> Vec3<N>
Gets the inverse rotation associated with self
.
fn append_rotation_mut(&mut self, amount: &Vec3<N>)
Appends a rotation to this object.
fn append_rotation(&self, amount: &Vec3<N>) -> UnitQuat<N>
Appends the rotation amount
to a copy of t
.
fn prepend_rotation_mut(&mut self, amount: &Vec3<N>)
Prepends a rotation to this object.
fn prepend_rotation(&self, amount: &Vec3<N>) -> UnitQuat<N>
Prepends the rotation amount
to a copy of t
.
fn set_rotation(&mut self, v: Vec3<N>)
Sets the rotation of self
.
impl<N: BaseFloat> RotationMatrix<N, Vec3<N>, Vec3<N>> for UnitQuat<N>
[src]
type Output = Rot3<N>
The output rotation matrix type.
fn to_rot_mat(&self) -> Rot3<N>
Gets the rotation matrix represented by self
.
impl<N: BaseNum + Neg<Output=N>> Rotate<Vec3<N>> for UnitQuat<N>
[src]
fn rotate(&self, v: &Vec3<N>) -> Vec3<N>
Applies a rotation to v
.
fn inv_rotate(&self, v: &Vec3<N>) -> Vec3<N>
Applies an inverse rotation to v
.
impl<N: BaseNum + Neg<Output=N>> Rotate<Pnt3<N>> for UnitQuat<N>
[src]
fn rotate(&self, p: &Pnt3<N>) -> Pnt3<N>
Applies a rotation to v
.
fn inv_rotate(&self, p: &Pnt3<N>) -> Pnt3<N>
Applies an inverse rotation to v
.
impl<N: BaseFloat + ApproxEq<N>> RotationTo for UnitQuat<N>
[src]
type AngleType = N
Type of the angle between two elements.
type DeltaRotationType = UnitQuat<N>
Type of the rotation between two elements.
fn angle_to(&self, other: &Self) -> N
Computes an angle nedded to transform the first element to the second one using a rotation. Read more
fn rotation_to(&self, other: &Self) -> UnitQuat<N>
Computes the smallest rotation needed to transform the first element to the second one.
impl<N: BaseNum + Neg<Output=N>> Transform<Vec3<N>> for UnitQuat<N>
[src]
fn transform(&self, v: &Vec3<N>) -> Vec3<N>
Applies a transformation to v
.
fn inv_transform(&self, v: &Vec3<N>) -> Vec3<N>
Applies an inverse transformation to v
.
impl<N: BaseNum + Neg<Output=N>> Transform<Pnt3<N>> for UnitQuat<N>
[src]
fn transform(&self, p: &Pnt3<N>) -> Pnt3<N>
Applies a transformation to v
.
fn inv_transform(&self, p: &Pnt3<N>) -> Pnt3<N>
Applies an inverse transformation to v
.