#[repr(C, align(16))]pub struct Quat {
pub x: f32,
pub y: f32,
pub z: f32,
pub w: f32,
}Expand description
A SIMD-aligned quaternion stored as (x, y, z, w).
Fields§
§x: f32X component.
y: f32Y component.
z: f32Z component.
w: f32Scalar component.
Implementations§
Source§impl Quat
impl Quat
Sourcepub const fn from_array(value: [f32; 4]) -> Self
pub const fn from_array(value: [f32; 4]) -> Self
Builds from an array.
Sourcepub fn from_rotation_x(angle: f32) -> Self
pub fn from_rotation_x(angle: f32) -> Self
Rotation around X.
Sourcepub fn from_rotation_y(angle: f32) -> Self
pub fn from_rotation_y(angle: f32) -> Self
Rotation around Y.
Sourcepub fn from_rotation_z(angle: f32) -> Self
pub fn from_rotation_z(angle: f32) -> Self
Rotation around Z.
Sourcepub fn from_axis_angle(axis: Vec3, angle: f32) -> Self
pub fn from_axis_angle(axis: Vec3, angle: f32) -> Self
Rotation around a normalized axis.
Sourcepub fn from_rotation_arc(from: Vec3, to: Vec3) -> Self
pub fn from_rotation_arc(from: Vec3, to: Vec3) -> Self
Shortest rotation between directions.
Sourcepub fn length_squared(self) -> f32
pub fn length_squared(self) -> f32
Squared quaternion length.
Trait Implementations§
impl Copy for Quat
Source§impl<'de> Deserialize<'de> for Quat
impl<'de> Deserialize<'de> for Quat
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Pod for Quat
impl StructuralPartialEq for Quat
Auto Trait Implementations§
impl Freeze for Quat
impl RefUnwindSafe for Quat
impl Send for Quat
impl Sync for Quat
impl Unpin for Quat
impl UnsafeUnpin for Quat
impl UnwindSafe for Quat
Blanket Implementations§
impl<T> AnyBitPattern for Twhere
T: Pod,
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
Source§impl<T> CheckedBitPattern for Twhere
T: AnyBitPattern,
impl<T> CheckedBitPattern for Twhere
T: AnyBitPattern,
Source§type Bits = T
type Bits = T
Self must have the same layout as the specified Bits except for
the possible invalid bit patterns being checked during
is_valid_bit_pattern.Source§fn is_valid_bit_pattern(_bits: &T) -> bool
fn is_valid_bit_pattern(_bits: &T) -> bool
If this function returns true, then it must be valid to reinterpret
bits
as &Self.Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more