#[repr(C)]pub struct QuatFix {
pub x: Fix128,
pub y: Fix128,
pub z: Fix128,
pub w: Fix128,
}Expand description
Quaternion using Fix128 components (for rotations)
Stored as (x, y, z, w) where w is the scalar part
Fields§
§x: Fix128X component (imaginary i)
y: Fix128Y component (imaginary j)
z: Fix128Z component (imaginary k)
w: Fix128W component (scalar/real part)
Implementations§
Source§impl QuatFix
impl QuatFix
Sourcepub fn from_axis_angle(axis: Vec3Fix, angle: Fix128) -> Self
pub fn from_axis_angle(axis: Vec3Fix, angle: Fix128) -> Self
Create from axis-angle representation
Sourcepub fn length_squared(self) -> Fix128
pub fn length_squared(self) -> Fix128
Squared magnitude
Sourcepub fn normalize(self) -> Self
pub fn normalize(self) -> Self
Normalize to unit quaternion (reciprocal: 1 division + 4 multiplications)
Sourcepub fn rotate_vec(self, v: Vec3Fix) -> Vec3Fix
pub fn rotate_vec(self, v: Vec3Fix) -> Vec3Fix
Rotate a vector by this quaternion
Trait Implementations§
impl Copy for QuatFix
impl Eq for QuatFix
impl StructuralPartialEq for QuatFix
Auto Trait Implementations§
impl Freeze for QuatFix
impl RefUnwindSafe for QuatFix
impl Send for QuatFix
impl Sync for QuatFix
impl Unpin for QuatFix
impl UnsafeUnpin for QuatFix
impl UnwindSafe for QuatFix
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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