[][src]Struct ico_math::Quaternion

#[repr(C)]
pub struct Quaternion {
    pub data: __m128,
}

Fields

data: __m128

Methods

impl Quaternion[src]

pub fn new(x: f32, y: f32, z: f32, w: f32) -> Quaternion[src]

Construct a new quaternion from f32 components. This may result in an invalid quaternion.

pub fn identity() -> Quaternion[src]

Construct a new identity quaternion.

pub fn load(raw: &RawVector_f32) -> Quaternion[src]

Load a value from aligned memory.

pub fn store(self, dst: &mut RawVector_f32)[src]

Store a value to aligned memory.

pub fn angle_axis<T: Into<FloatVector>>(radians: T, axis: Vector3) -> Quaternion[src]

Construct a new quaternion from axis-angle format.

pub fn x(self) -> FloatVector[src]

Get the x value of the quaternion, broadcast to all components as a FloatVector (xxxx).

pub fn y(self) -> FloatVector[src]

Get the y value of the quaternion, broadcast to all components as a FloatVector (yyyy).

pub fn z(self) -> FloatVector[src]

Get the z value of the quaternion, broadcast to all components as a FloatVector (zzzz).

pub fn w(self) -> FloatVector[src]

Get the w value of the quaternion, broadcast to all components as a FloatVector (wwww).

pub fn set_x<T: Into<FloatVector>>(&mut self, value: T)[src]

Set the x value of this quaternion, leaving the other components unchanged.

pub fn set_y<T: Into<FloatVector>>(&mut self, value: T)[src]

Set the y value of this quaternion, leaving the other components unchanged.

pub fn set_z<T: Into<FloatVector>>(&mut self, value: T)[src]

Set the z value of this quaternion, leaving the other components unchanged.

pub fn set_w<T: Into<FloatVector>>(&mut self, value: T)[src]

Set the w value of this quaternion, leaving the other components unchanged.

pub fn mul_vec(quat: Quaternion, vec: Vector3) -> Vector3[src]

pub fn mul(lhs: Quaternion, rhs: Quaternion) -> Quaternion[src]

pub fn equal(self, v2: Quaternion) -> Vector4Bool[src]

Equals, computed component-wise. This compares bits, and is exact.

pub fn not_equal(self, v2: Quaternion) -> Vector4Bool[src]

NotEquals, computed component-wise. This compares bits, and is exact.

pub fn greater_equal(self, v2: Quaternion) -> Vector4Bool[src]

Greater than or equal to, computed component-wise. This compares bits, and is exact.

pub fn greater(self, v2: Quaternion) -> Vector4Bool[src]

Greater than, computed component-wise. This compares bits, and is exact.

pub fn less_equal(self, v2: Quaternion) -> Vector4Bool[src]

Less than or equal to, computed component-wise. This compares bits, and is exact.

pub fn less(self, v2: Quaternion) -> Vector4Bool[src]

Less than, computed component-wise. This compares bits, and is exact.

pub fn dot(self, q2: Quaternion) -> FloatVector[src]

pub fn sqr_magnitude(self) -> FloatVector[src]

pub fn magnitude(self) -> FloatVector[src]

pub fn inverse(self) -> Quaternion[src]

pub fn reverse(self) -> Quaternion[src]

pub fn delta(from: Quaternion, to: Quaternion) -> Quaternion[src]

pub fn shortest_delta(self, to: Quaternion) -> Quaternion[src]

pub fn angle(self, b: Quaternion) -> FloatVector[src]

pub fn renormalize(self) -> Quaternion[src]

A fast normalize (q = q / q.magnitude). When the length is 0, this will divide by 0 - and may produce infinity or NaN. Only should be used if the Quaternion is known to be non-zero.

pub fn normalize(self) -> Quaternion[src]

A safe normalize. If the quaternion is 0, returns Identity.

pub fn select(self, v2: Quaternion, mask: Vector4Bool) -> Quaternion[src]

Choose component wise between A and B based on the mask. False = A, True = B.

pub fn lerp<T: Into<FloatVector>>(self, to: Quaternion, t: T) -> Quaternion[src]

pub fn slerp<T: Into<FloatVector>>(self, to: Quaternion, t: T) -> Quaternion[src]

Spherical linear interpolation. This one in particular is probably slow.
It uses SIMD approximations for acos and sin, however, it could almost certainly be improved.

pub fn euler(radians: Vector3, rotation_order: RotationOrder) -> Quaternion[src]

pub fn approx_equal(self, to: Quaternion) -> bool[src]

Are these quaternions approximately the same, within ~0.163 degrees

Trait Implementations

impl Clone for Quaternion[src]

fn clone_from(&mut self, source: &Self)1.0.0[src]

Performs copy-assignment from source. Read more

impl From<Vector4> for Quaternion[src]

impl From<Quaternion> for Vector4[src]

impl PartialEq<Quaternion> for Quaternion[src]

#[must_use] fn ne(&self, other: &Rhs) -> bool1.0.0[src]

This method tests for !=.

impl Copy for Quaternion[src]

impl Debug for Quaternion[src]

impl Mul<Quaternion> for Quaternion[src]

type Output = Quaternion

The resulting type after applying the * operator.

impl Mul<Vector3> for Quaternion[src]

type Output = Vector3

The resulting type after applying the * operator.

impl MulAssign<Quaternion> for Quaternion[src]

Auto Trait Implementations

Blanket Implementations

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]