pub struct Quaternion {
pub x: f32,
pub y: f32,
pub z: f32,
pub w: f32,
}Expand description
Unit quaternion used for 3D rotation interpolation.
The components are stored as (x, y, z, w). Interpolate uses
shortest-path spherical linear interpolation.
Fields§
§x: f32X component of the vector part.
y: f32Y component of the vector part.
z: f32Z component of the vector part.
w: f32Scalar part.
Implementations§
Source§impl Quaternion
impl Quaternion
Sourcepub fn from_axis_angle(axis: [f32; 3], angle: Angle) -> Self
pub fn from_axis_angle(axis: [f32; 3], angle: Angle) -> Self
Create a quaternion from an axis and angle in degrees.
Sourcepub fn normalized(self) -> Self
pub fn normalized(self) -> Self
Return a normalized quaternion, or identity when length is invalid.
Trait Implementations§
Source§impl Clone for Quaternion
impl Clone for Quaternion
Source§fn clone(&self) -> Quaternion
fn clone(&self) -> Quaternion
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for Quaternion
Source§impl Debug for Quaternion
impl Debug for Quaternion
Source§impl Interpolate for Quaternion
impl Interpolate for Quaternion
Source§impl PartialEq for Quaternion
impl PartialEq for Quaternion
Source§fn eq(&self, other: &Quaternion) -> bool
fn eq(&self, other: &Quaternion) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for Quaternion
Auto Trait Implementations§
impl Freeze for Quaternion
impl RefUnwindSafe for Quaternion
impl Send for Quaternion
impl Sync for Quaternion
impl Unpin for Quaternion
impl UnsafeUnpin for Quaternion
impl UnwindSafe for Quaternion
Blanket Implementations§
impl<T> Animatable for Twhere
T: Interpolate + Clone + 'static,
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more