#[repr(C)]pub struct Quat<T: QuatScalar> {
pub x: T,
pub y: T,
pub z: T,
pub w: T,
}Expand description
A quaternion type, representing a rotation in 3D space.
Fields§
§x: TThe x component of the quaternion.
y: TThe y component of the quaternion.
z: TThe z component of the quaternion.
w: TThe w component of the quaternion.
Implementations§
Source§impl<T: QuatScalar> Quat<T>
impl<T: QuatScalar> Quat<T>
Source§impl<T> Quat<T>where
T: QuatScalar,
impl<T> Quat<T>where
T: QuatScalar,
Sourcepub const fn splat(scalar: T) -> Self
pub const fn splat(scalar: T) -> Self
Creates a new instance of the tuple type with all elements set to the given scalar value.
Sourcepub const fn as_ptr(&self) -> *const T
pub const fn as_ptr(&self) -> *const T
Returns a raw pointer to the first element of the tuple.
Sourcepub const fn as_mut_ptr(&mut self) -> *mut T
pub const fn as_mut_ptr(&mut self) -> *mut T
Returns a mutable raw pointer to the first element of the tuple.
Sourcepub const fn as_mut_slice(&mut self) -> &mut [T]
pub const fn as_mut_slice(&mut self) -> &mut [T]
Returns a mutable slice containing all elements of the tuple.
Sourcepub const fn from_array(a: [T; 4]) -> Self
pub const fn from_array(a: [T; 4]) -> Self
Creates a new instance of the tuple type from an array of scalar elements.
Trait Implementations§
Source§impl<T> AbsDiffEq for Quat<T>where
T: QuatScalar + AbsDiffEq<Epsilon = T>,
impl<T> AbsDiffEq for Quat<T>where
T: QuatScalar + AbsDiffEq<Epsilon = T>,
Source§fn default_epsilon() -> Self::Epsilon
fn default_epsilon() -> Self::Epsilon
The default tolerance to use when testing values that are close together. Read more
Source§fn abs_diff_eq(&self, other: &Self, epsilon: Self::Epsilon) -> bool
fn abs_diff_eq(&self, other: &Self, epsilon: Self::Epsilon) -> bool
A test for equality that uses the absolute difference to compute the approximate
equality of two numbers.
Source§fn abs_diff_ne(&self, other: &Rhs, epsilon: Self::Epsilon) -> bool
fn abs_diff_ne(&self, other: &Rhs, epsilon: Self::Epsilon) -> bool
The inverse of
AbsDiffEq::abs_diff_eq.impl<T: Copy + QuatScalar> Copy for Quat<T>
Source§impl<T> Default for Quat<T>where
T: QuatScalar,
impl<T> Default for Quat<T>where
T: QuatScalar,
Source§impl<T> DotProduct for Quat<T>where
T: QuatScalar,
impl<T> DotProduct for Quat<T>where
T: QuatScalar,
Source§impl<T> HasScalar for Quat<T>where
T: QuatScalar,
impl<T> HasScalar for Quat<T>where
T: QuatScalar,
Source§impl<T> Neg for Quat<T>where
T: QuatScalar,
impl<T> Neg for Quat<T>where
T: QuatScalar,
Source§impl<T> Negate for Quat<T>where
T: QuatScalar,
impl<T> Negate for Quat<T>where
T: QuatScalar,
impl<T> Quaternion for Quat<T>where
T: QuatScalar,
Source§impl<T> RelativeEq for Quat<T>where
T: QuatScalar + RelativeEq<Epsilon = T>,
impl<T> RelativeEq for Quat<T>where
T: QuatScalar + RelativeEq<Epsilon = T>,
Source§fn default_max_relative() -> Self::Epsilon
fn default_max_relative() -> Self::Epsilon
The default relative tolerance for testing values that are far-apart. Read more
Source§fn relative_eq(
&self,
other: &Self,
epsilon: Self::Epsilon,
max_relative: Self::Epsilon,
) -> bool
fn relative_eq( &self, other: &Self, epsilon: Self::Epsilon, max_relative: Self::Epsilon, ) -> bool
A test for equality that uses a relative comparison if the values are far apart.
Source§fn relative_ne(
&self,
other: &Rhs,
epsilon: Self::Epsilon,
max_relative: Self::Epsilon,
) -> bool
fn relative_ne( &self, other: &Rhs, epsilon: Self::Epsilon, max_relative: Self::Epsilon, ) -> bool
The inverse of
RelativeEq::relative_eq.Source§impl<T> ScalarTuple for Quat<T>where
T: QuatScalar,
impl<T> ScalarTuple for Quat<T>where
T: QuatScalar,
Source§type Array = [T; 4]
type Array = [T; 4]
The array type corresponding to the tuple, containing the same number of scalar elements.
Source§fn splat(scalar: Self::Scalar) -> Self
fn splat(scalar: Self::Scalar) -> Self
Creates a new instance of the tuple type with all elements set to the given scalar value.
Source§fn as_ptr(&self) -> *const Self::Scalar
fn as_ptr(&self) -> *const Self::Scalar
Returns a raw pointer to the first element of the tuple.
Source§fn as_mut_ptr(&mut self) -> *mut Self::Scalar
fn as_mut_ptr(&mut self) -> *mut Self::Scalar
Returns a mutable raw pointer to the first element of the tuple.
Source§fn as_mut_slice(&mut self) -> &mut [Self::Scalar]
fn as_mut_slice(&mut self) -> &mut [Self::Scalar]
Returns a mutable slice containing all elements of the tuple.
Source§fn from_array(a: Self::Array) -> Self
fn from_array(a: Self::Array) -> Self
Creates a new instance of the tuple type from an array of scalar elements.
impl<T: PartialEq + QuatScalar> StructuralPartialEq for Quat<T>
Source§impl<T> UlpsEq for Quat<T>where
T: QuatScalar + UlpsEq<Epsilon = T>,
impl<T> UlpsEq for Quat<T>where
T: QuatScalar + UlpsEq<Epsilon = T>,
Auto Trait Implementations§
impl<T> Freeze for Quat<T>where
T: Freeze,
impl<T> RefUnwindSafe for Quat<T>where
T: RefUnwindSafe,
impl<T> Send for Quat<T>where
T: Send,
impl<T> Sync for Quat<T>where
T: Sync,
impl<T> Unpin for Quat<T>where
T: Unpin,
impl<T> UnsafeUnpin for Quat<T>where
T: UnsafeUnpin,
impl<T> UnwindSafe for Quat<T>where
T: UnwindSafe,
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