Struct ggez::graphics::na::Quaternion [] [src]

#[repr(C)]
pub struct Quaternion<N> where
    N: Real
{ pub coords: Matrix<N, U4, U1, <DefaultAllocator as Allocator<N, U4, U1>>::Buffer>, }

A quaternion. See the type alias UnitQuaternion = Unit<Quaternion> for a quaternion that may be used as a rotation.

Fields

This quaternion as a 4D vector of coordinates in the [ x, y, z, w ] storage order.

Methods

impl<N> Quaternion<N> where
    N: Real
[src]

[src]

Deprecated

: This method is a no-op and will be removed in a future release.

Moves this unit quaternion into one that owns its data.

[src]

Deprecated

: This method is a no-op and will be removed in a future release.

Clones this unit quaternion into one that owns its data.

[src]

Normalizes this quaternion.

[src]

Compute the conjugate of this quaternion.

[src]

Inverts this quaternion if it is not zero.

[src]

Linear interpolation between two quaternion.

[src]

The vector part (i, j, k) of this quaternion.

[src]

The scalar part w of this quaternion.

[src]

Reinterprets this quaternion as a 4D vector.

[src]

The norm of this quaternion.

[src]

The squared norm of this quaternion.

[src]

The polar decomposition of this quaternion.

Returns, from left to right: the quaternion norm, the half rotation angle, the rotation axis. If the rotation angle is zero, the rotation axis is set to None.

[src]

Compute the exponential of a quaternion.

[src]

Compute the natural logarithm of a quaternion.

[src]

Raise the quaternion to a given floating power.

[src]

Transforms this quaternion into its 4D vector form (Vector part, Scalar part).

[src]

The mutable vector part (i, j, k) of this quaternion.

[src]

Replaces this quaternion by its conjugate.

[src]

Inverts this quaternion in-place if it is not zero.

[src]

Normalizes this quaternion.

impl<N> Quaternion<N> where
    N: Real
[src]

[src]

Creates a quaternion from a 4D vector. The quaternion scalar part corresponds to the w vector component.

[src]

Creates a new quaternion from its individual components. Note that the arguments order does not follow the storage order.

The storage order is [ x, y, z, w ].

[src]

Creates a new quaternion from its scalar and vector parts. Note that the arguments order does not follow the storage order.

The storage order is [ vector, scalar ].

[src]

Creates a new quaternion from its polar decomposition.

Note that axis is assumed to be a unit vector.

[src]

The quaternion multiplicative identity.

Trait Implementations

impl<N> Neg for Quaternion<N> where
    N: Real
[src]

[src]

impl<'a, N> Neg for &'a Quaternion<N> where
    N: Real
[src]

[src]

impl<N> Rand for Quaternion<N> where
    N: Rand + Real
[src]

[src]

impl<N> Copy for Quaternion<N> where
    N: Real
[src]

impl<N> Clone for Quaternion<N> where
    N: Real
[src]

[src]

Returns a copy of the value. Read more

1.0.0
[src]

Performs copy-assignment from source. Read more

impl<N> AbstractMonoid<Additive> for Quaternion<N> where
    N: Real
[src]

impl<N> AbstractMonoid<Multiplicative> for Quaternion<N> where
    N: Real
[src]

impl<N1, N2> SubsetOf<Quaternion<N2>> for Quaternion<N1> where
    N1: Real,
    N2: Real + SupersetOf<N1>, 
[src]

impl<N> Inverse<Additive> for Quaternion<N> where
    N: Real
[src]

[src]

impl<'a, N> Div<N> for &'a Quaternion<N> where
    N: Real
[src]

[src]

impl<N> Div<N> for Quaternion<N> where
    N: Real
[src]

[src]

impl<N> AbstractSemigroup<Additive> for Quaternion<N> where
    N: Real
[src]

impl<N> AbstractSemigroup<Multiplicative> for Quaternion<N> where
    N: Real
[src]

impl<N> NormedSpace for Quaternion<N> where
    N: Real
[src]

[src]

[src]

[src]

[src]

[src]

[src]

impl<N> AbstractLoop<Additive> for Quaternion<N> where
    N: Real
[src]

impl<N> DivAssign<N> for Quaternion<N> where
    N: Real
[src]

[src]

impl<N> VectorSpace for Quaternion<N> where
    N: Real
[src]

impl<N> ApproxEq for Quaternion<N> where
    N: ApproxEq<Epsilon = N> + Real
[src]

[src]

[src]

[src]

[src]

[src]

impl<N> Hash for Quaternion<N> where
    N: Hash + Real
[src]

[src]

Feeds this value into the given [Hasher]. Read more

1.3.0
[src]

Feeds a slice of this type into the given [Hasher]. Read more

impl<N> DerefMut for Quaternion<N> where
    N: Real
[src]

[src]

impl<N> PartialEq<Quaternion<N>> for Quaternion<N> where
    N: Real
[src]

[src]

This method tests for self and other values to be equal, and is used by ==. Read more

1.0.0
[src]

This method tests for !=.

impl<N> Add<Quaternion<N>> for Quaternion<N> where
    N: Real,
    DefaultAllocator: Allocator<N, U4, U1>,
    DefaultAllocator: Allocator<N, U4, U1>, 
[src]

[src]

impl<'a, N> Add<Quaternion<N>> for &'a Quaternion<N> where
    N: Real,
    DefaultAllocator: Allocator<N, U4, U1>,
    DefaultAllocator: Allocator<N, U4, U1>, 
[src]

[src]

impl<'b, N> Add<&'b Quaternion<N>> for Quaternion<N> where
    N: Real,
    DefaultAllocator: Allocator<N, U4, U1>,
    DefaultAllocator: Allocator<N, U4, U1>, 
[src]

[src]

impl<'a, 'b, N> Add<&'b Quaternion<N>> for &'a Quaternion<N> where
    N: Real,
    DefaultAllocator: Allocator<N, U4, U1>,
    DefaultAllocator: Allocator<N, U4, U1>, 
[src]

[src]

impl<N> Debug for Quaternion<N> where
    N: Debug + Real
[src]

[src]

Formats the value using the given formatter.

impl<N> FiniteDimVectorSpace for Quaternion<N> where
    N: Real
[src]

[src]

[src]

[src]

[src]

[src]

impl<'b, N> AddAssign<&'b Quaternion<N>> for Quaternion<N> where
    N: Real,
    DefaultAllocator: Allocator<N, U4, U1>,
    DefaultAllocator: Allocator<N, U4, U1>, 
[src]

[src]

impl<N> AddAssign<Quaternion<N>> for Quaternion<N> where
    N: Real,
    DefaultAllocator: Allocator<N, U4, U1>,
    DefaultAllocator: Allocator<N, U4, U1>, 
[src]

[src]

impl<N> AbstractQuasigroup<Additive> for Quaternion<N> where
    N: Real
[src]

impl<N> SubAssign<Quaternion<N>> for Quaternion<N> where
    N: Real,
    DefaultAllocator: Allocator<N, U4, U1>,
    DefaultAllocator: Allocator<N, U4, U1>, 
[src]

[src]

impl<'b, N> SubAssign<&'b Quaternion<N>> for Quaternion<N> where
    N: Real,
    DefaultAllocator: Allocator<N, U4, U1>,
    DefaultAllocator: Allocator<N, U4, U1>, 
[src]

[src]

impl<N> AbstractGroup<Additive> for Quaternion<N> where
    N: Real
[src]

impl<N> One for Quaternion<N> where
    N: Real
[src]

[src]

impl<N> AbstractModule<Additive, Additive, Multiplicative> for Quaternion<N> where
    N: Real
[src]

[src]

impl<N> Index<usize> for Quaternion<N> where
    N: Real
[src]

[src]

impl<N> Identity<Multiplicative> for Quaternion<N> where
    N: Real
[src]

impl<N> Identity<Additive> for Quaternion<N> where
    N: Real
[src]

impl<N> Eq for Quaternion<N> where
    N: Eq + Real
[src]

impl<N> Deref for Quaternion<N> where
    N: Real
[src]

[src]

impl<N> AbstractGroupAbelian<Additive> for Quaternion<N> where
    N: Real
[src]

impl<N> Zero for Quaternion<N> where
    N: Real
[src]

[src]

[src]

impl<N> MulAssign<Quaternion<N>> for Quaternion<N> where
    N: Real,
    DefaultAllocator: Allocator<N, U4, U1>,
    DefaultAllocator: Allocator<N, U4, U1>, 
[src]

[src]

impl<N> MulAssign<N> for Quaternion<N> where
    N: Real
[src]

[src]

impl<'b, N> MulAssign<&'b Quaternion<N>> for Quaternion<N> where
    N: Real,
    DefaultAllocator: Allocator<N, U4, U1>,
    DefaultAllocator: Allocator<N, U4, U1>, 
[src]

[src]

impl<N> AbstractMagma<Additive> for Quaternion<N> where
    N: Real
[src]

[src]

impl<N> AbstractMagma<Multiplicative> for Quaternion<N> where
    N: Real
[src]

[src]

impl<N> Mul<Quaternion<N>> for Quaternion<N> where
    N: Real,
    DefaultAllocator: Allocator<N, U4, U1>,
    DefaultAllocator: Allocator<N, U4, U1>, 
[src]

[src]

impl<'a, N> Mul<N> for &'a Quaternion<N> where
    N: Real
[src]

[src]

impl<N> Mul<N> for Quaternion<N> where
    N: Real
[src]

[src]

impl<'a, N> Mul<Quaternion<N>> for &'a Quaternion<N> where
    N: Real,
    DefaultAllocator: Allocator<N, U4, U1>,
    DefaultAllocator: Allocator<N, U4, U1>, 
[src]

[src]

impl<'b, N> Mul<&'b Quaternion<N>> for Quaternion<N> where
    N: Real,
    DefaultAllocator: Allocator<N, U4, U1>,
    DefaultAllocator: Allocator<N, U4, U1>, 
[src]

[src]

impl<'a, 'b, N> Mul<&'b Quaternion<N>> for &'a Quaternion<N> where
    N: Real,
    DefaultAllocator: Allocator<N, U4, U1>,
    DefaultAllocator: Allocator<N, U4, U1>, 
[src]

[src]

impl<N> Module for Quaternion<N> where
    N: Real
[src]

impl<N> IndexMut<usize> for Quaternion<N> where
    N: Real
[src]

[src]

impl<'a, 'b, N> Sub<&'b Quaternion<N>> for &'a Quaternion<N> where
    N: Real,
    DefaultAllocator: Allocator<N, U4, U1>,
    DefaultAllocator: Allocator<N, U4, U1>, 
[src]

[src]

impl<'b, N> Sub<&'b Quaternion<N>> for Quaternion<N> where
    N: Real,
    DefaultAllocator: Allocator<N, U4, U1>,
    DefaultAllocator: Allocator<N, U4, U1>, 
[src]

[src]

impl<N> Sub<Quaternion<N>> for Quaternion<N> where
    N: Real,
    DefaultAllocator: Allocator<N, U4, U1>,
    DefaultAllocator: Allocator<N, U4, U1>, 
[src]

[src]

impl<'a, N> Sub<Quaternion<N>> for &'a Quaternion<N> where
    N: Real,
    DefaultAllocator: Allocator<N, U4, U1>,
    DefaultAllocator: Allocator<N, U4, U1>, 
[src]

[src]

impl<N> Display for Quaternion<N> where
    N: Display + Real
[src]

[src]

Formats the value using the given formatter. Read more