Skip to main content

Quaternionx8

Struct Quaternionx8 

Source
pub struct Quaternionx8 {
    pub w: f64x8,
    pub x: f64x8,
    pub y: f64x8,
    pub z: f64x8,
}
Expand description

SoA. Performs operations on x quaternions

Fields§

§w: f64x8§x: f64x8§y: f64x8§z: f64x8

Implementations§

Source§

impl Quaternionx8

Source

pub fn magnitude(&self) -> f64x8

Returns the magnitude.

Source

pub fn normalize(&mut self)

Normalize, modifying in place.

Source

pub fn to_normalized(self) -> Self

Returns the normalized version of the vector.

Source

pub fn dot(&self, rhs: Self) -> f64x8

Used by slerp.

Source

pub fn inverse(self) -> Self

Source

pub fn rotate_vec(self, vec: Vec3x8) -> Vec3x8

Rotate a vector using this quaternion. Note that our multiplication Q * v operation is effectively quaternion multiplication, with a quaternion created by a vec with w=0. Uses the X_VEC hand rule.

Source§

impl Quaternionx8

Source

pub fn from_array(slots: [Quaternion; 8]) -> Self

Create a new x-lane, SoA, $f Vec3

Source

pub fn from_slice(slice: &[Quaternion]) -> Self

Source

pub fn to_array(self) -> [Quaternion; 8]

Convert the SoA data back into an array of eight Quaternions.

Source

pub fn new_identity() -> Self

Source

pub fn splat(val: Quaternion) -> Self

Source

pub fn to_vec(self) -> Vec3x8

Converts the SIMD quaternion to a SIMD 3D vector, discarding w.

Trait Implementations§

Source§

impl Add for Quaternionx8

Source§

type Output = Quaternionx8

The resulting type after applying the + operator.
Source§

fn add(self, rhs: Self) -> Self::Output

Performs the + operation. Read more
Source§

impl Clone for Quaternionx8

Source§

fn clone(&self) -> Quaternionx8

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Quaternionx8

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for Quaternionx8

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl Div<f64x8> for Quaternionx8

Source§

type Output = Quaternionx8

The resulting type after applying the / operator.
Source§

fn div(self, rhs: f64x8) -> Self::Output

Performs the / operation. Read more
Source§

impl Div for Quaternionx8

Source§

type Output = Quaternionx8

The resulting type after applying the / operator.
Source§

fn div(self, rhs: Self) -> Self::Output

Performs the / operation. Read more
Source§

impl DivAssign<f64x8> for Quaternionx8

Source§

fn div_assign(&mut self, rhs: f64x8)

Performs the /= operation. Read more
Source§

impl Mul<Vec3x8> for Quaternionx8

Source§

fn mul(self, rhs: Vec3x8) -> Self::Output

Returns the multiplication of a Quaternion with a vector. This is a normal Quaternion multiplication where the vector is treated as a Quaternion with a W element value of zero. The Quaternion is post- multiplied by the vector.

Source§

type Output = Quaternionx8

The resulting type after applying the * operator.
Source§

impl Mul<f64> for Quaternionx8

Source§

type Output = Quaternionx8

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: f64) -> Self::Output

Performs the * operation. Read more
Source§

impl Mul<f64x8> for Quaternionx8

Source§

type Output = Quaternionx8

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: f64x8) -> Self::Output

Performs the * operation. Read more
Source§

impl Mul for Quaternionx8

Source§

type Output = Quaternionx8

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: Self) -> Self::Output

Performs the * operation. Read more
Source§

impl MulAssign<f64x8> for Quaternionx8

Source§

fn mul_assign(&mut self, rhs: f64x8)

Performs the *= operation. Read more
Source§

impl Sub for Quaternionx8

Source§

type Output = Quaternionx8

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: Self) -> Self::Output

Performs the - operation. Read more
Source§

impl Copy for Quaternionx8

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.