[−][src]Struct tray_rust::linalg::quaternion::Quaternion
Quaternions describe a rotation in 3d space but can be properly interpolated unlike rotation matrices. The quaternion also provides methods to compute the corresponding rotation transform so that it can be composed with scaling and translation
Fields
v: Vector
w: f32
Methods
impl Quaternion
[src]
pub fn identity() -> Quaternion
[src]
Construct an identity quaternion
pub fn from_matrix(m: &Matrix4) -> Quaternion
[src]
Construct a quaternion from the rotation matrix Based on Shoemake 1991
pub fn from_transform(t: &Transform) -> Quaternion
[src]
Construct the quaternion from the transform
pub fn to_matrix(&self) -> Matrix4
[src]
Get the rotation transform described by this quaternion
pub fn to_transform(&self) -> Transform
[src]
Get the rotation transform described by this quaternion
pub fn normalized(&self) -> Quaternion
[src]
Get the normalized quaternion for this rotation
Trait Implementations
impl Clone for Quaternion
[src]
fn clone(&self) -> Quaternion
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Copy for Quaternion
[src]
impl Debug for Quaternion
[src]
impl Div<f32> for Quaternion
[src]
type Output = Quaternion
The resulting type after applying the /
operator.
fn div(self, rhs: f32) -> Quaternion
[src]
Divide the quaternion by a scalar
impl Sub<Quaternion> for Quaternion
[src]
type Output = Quaternion
The resulting type after applying the -
operator.
fn sub(self, rhs: Quaternion) -> Quaternion
[src]
Subtract two quaternions
impl Add<Quaternion> for Quaternion
[src]
type Output = Quaternion
The resulting type after applying the +
operator.
fn add(self, rhs: Quaternion) -> Quaternion
[src]
Add two quaternions
impl Mul<f32> for Quaternion
[src]
type Output = Quaternion
The resulting type after applying the *
operator.
fn mul(self, rhs: f32) -> Quaternion
[src]
Multiply the quaternion by a scalar
impl Mul<Quaternion> for f32
[src]
type Output = Quaternion
The resulting type after applying the *
operator.
fn mul(self, rhs: Quaternion) -> Quaternion
[src]
Multiply the quaternion by a scalar
impl Neg for Quaternion
[src]
type Output = Quaternion
The resulting type after applying the -
operator.
fn neg(self) -> Quaternion
[src]
Negate the quaternion
Auto Trait Implementations
impl Send for Quaternion
impl Sync for Quaternion
impl Unpin for Quaternion
impl UnwindSafe for Quaternion
impl RefUnwindSafe for Quaternion
Blanket Implementations
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From<T> for T
[src]
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Interpolate for T where
T: Add<T, Output = T> + Mul<f32, Output = T> + Copy,
[src]
T: Add<T, Output = T> + Mul<f32, Output = T> + Copy,