#[repr(C)]pub struct Quaternion<T> {
pub v: Vector3<T>,
pub s: T,
}
Expand description
Standard quaternion represented by the scalar and vector parts. Useful for representing rotation in 3D space. Corresponds to a right-handed rotation matrix.
Fields§
§v: Vector3<T>
Vector part of a quaternion.
s: T
Scalar part of a quaternion.
Trait Implementations§
Source§impl<T> AsMut<[T; 4]> for Quaternion<T>
impl<T> AsMut<[T; 4]> for Quaternion<T>
Source§impl<T> AsRef<[T; 4]> for Quaternion<T>
impl<T> AsRef<[T; 4]> for Quaternion<T>
Source§impl<T: Clone> Clone for Quaternion<T>
impl<T: Clone> Clone for Quaternion<T>
Source§fn clone(&self) -> Quaternion<T>
fn clone(&self) -> Quaternion<T>
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl<T: Debug> Debug for Quaternion<T>
impl<T: Debug> Debug for Quaternion<T>
Source§impl<T> From<[T; 4]> for Quaternion<T>
impl<T> From<[T; 4]> for Quaternion<T>
Source§impl<T> From<Quaternion<T>> for [T; 4]
impl<T> From<Quaternion<T>> for [T; 4]
Source§fn from(quaternion: Quaternion<T>) -> [T; 4]
fn from(quaternion: Quaternion<T>) -> [T; 4]
Converts to this type from the input type.
Source§impl<T: Hash> Hash for Quaternion<T>
impl<T: Hash> Hash for Quaternion<T>
Source§impl<T> IntoMint for Quaternion<T>
impl<T> IntoMint for Quaternion<T>
Source§type MintType = Quaternion<T>
type MintType = Quaternion<T>
The mint type that this type is associated with.
Source§impl<T: Ord> Ord for Quaternion<T>
impl<T: Ord> Ord for Quaternion<T>
Source§fn cmp(&self, other: &Quaternion<T>) -> Ordering
fn cmp(&self, other: &Quaternion<T>) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl<T: PartialEq> PartialEq for Quaternion<T>
impl<T: PartialEq> PartialEq for Quaternion<T>
Source§impl<T: PartialOrd> PartialOrd for Quaternion<T>
impl<T: PartialOrd> PartialOrd for Quaternion<T>
impl<T: Copy> Copy for Quaternion<T>
impl<T: Eq> Eq for Quaternion<T>
impl<T> StructuralPartialEq for Quaternion<T>
Auto Trait Implementations§
impl<T> Freeze for Quaternion<T>where
T: Freeze,
impl<T> RefUnwindSafe for Quaternion<T>where
T: RefUnwindSafe,
impl<T> Send for Quaternion<T>where
T: Send,
impl<T> Sync for Quaternion<T>where
T: Sync,
impl<T> Unpin for Quaternion<T>where
T: Unpin,
impl<T> UnwindSafe for Quaternion<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