#[repr(C, align(16))]pub struct Quat {
pub x: f32,
pub y: f32,
pub z: f32,
pub w: f32,
}Expand description
Quaternion (xyzw layout, unit quaternion for rotations).
Fields§
§x: f32§y: f32§z: f32§w: f32Implementations§
Source§impl Quat
impl Quat
Sourcepub const fn from_xyzw(x: f32, y: f32, z: f32, w: f32) -> Self
pub const fn from_xyzw(x: f32, y: f32, z: f32, w: f32) -> Self
Creates a quaternion from raw x, y, z, w components.
Sourcepub fn from_axis_angle(axis: Vec3, angle: f32) -> Self
pub fn from_axis_angle(axis: Vec3, angle: f32) -> Self
Create a quaternion from axis-angle rotation.
Sourcepub fn from_euler(yaw: f32, pitch: f32, roll: f32) -> Self
pub fn from_euler(yaw: f32, pitch: f32, roll: f32) -> Self
Create from Euler angles (yaw, pitch, roll) in YXZ order.
Trait Implementations§
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 Copy 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§
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