Struct euler::DQuat

source ·
#[repr(C)]
pub struct DQuat { pub x: f64, pub y: f64, pub z: f64, pub s: f64, }
Expand description

Double-precision quaternion.

Fields§

§x: f64§y: f64§z: f64§s: f64

Implementations§

source§

impl DQuat

source

pub fn new(x: f64, y: f64, z: f64, s: f64) -> Self

Full constructor.

source

pub fn identity() -> Self

Identity constructor.

source

pub fn euler(angles: DVec3) -> Self

Constructor for a rotation defined by a set of Euler angles

The rotation order is Z, then X, then Y. From the point of the object, this is equivalent to a yaw in angles.y, a pitch in angles.x, and a roll in angles.z.

source

pub fn axis_angle(axis: DVec3, angle: f64) -> Self

Constructor for a rotation around axis by angle radians.

axis need not be normalized.

source

pub fn rotate(&self, vector: DVec3) -> DVec3

Return the application of the rotation represented by this quaternion to the vector argument.

Trait Implementations§

source§

impl ApproxEq for DQuat

§

type Epsilon = <Quaternion<f64> as ApproxEq>::Epsilon

Used for specifying relative comparisons.
source§

fn default_epsilon() -> Self::Epsilon

The default tolerance to use when testing values that are close together. Read more
source§

fn default_max_relative() -> Self::Epsilon

The default relative tolerance for testing values that are far-apart. Read more
source§

fn default_max_ulps() -> u32

The default ULPs to tolerate when testing values that are far-apart. Read more
source§

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 ulps_eq(&self, other: &Self, epsilon: Self::Epsilon, max_ulps: u32) -> bool

A test for equality that uses units in the last place (ULP) if the values are far apart.
source§

fn relative_ne( &self, other: &Self, epsilon: Self::Epsilon, max_relative: Self::Epsilon ) -> bool

The inverse of ApproxEq::relative_eq.
source§

fn ulps_ne(&self, other: &Self, epsilon: Self::Epsilon, max_ulps: u32) -> bool

The inverse of ApproxEq::ulps_eq.
source§

impl AsRef<[f64; 4]> for DQuat

source§

fn as_ref(&self) -> &[f64; 4]

Converts this type into a shared reference of the (usually inferred) input type.
source§

impl Clone for DQuat

source§

fn clone(&self) -> DQuat

Returns a copy 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 DQuat

source§

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

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

impl Default for DQuat

source§

fn default() -> Self

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

impl Display for DQuat

source§

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

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

impl From<[f64; 4]> for DQuat

source§

fn from(q: [f64; 4]) -> Self

Converts to this type from the input type.
source§

impl Into<[f64; 4]> for DQuat

source§

fn into(self) -> [f64; 4]

Converts this type into the (usually inferred) input type.
source§

impl Mul<DQuat> for DQuat

§

type Output = DQuat

The resulting type after applying the * operator.
source§

fn mul(self, rhs: DQuat) -> DQuat

Performs the * operation. Read more
source§

impl MulAssign<DQuat> for DQuat

source§

fn mul_assign(&mut self, rhs: DQuat)

Performs the *= operation. Read more
source§

impl PartialEq<DQuat> for DQuat

source§

fn eq(&self, other: &DQuat) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl Copy for DQuat

source§

impl StructuralPartialEq for DQuat

Auto Trait Implementations§

§

impl RefUnwindSafe for DQuat

§

impl Send for DQuat

§

impl Sync for DQuat

§

impl Unpin for DQuat

§

impl UnwindSafe for DQuat

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

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

source§

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

Mutably borrows from an owned value. 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 Twhere 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 Twhere T: Clone,

§

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> ToString for Twhere T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

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

§

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 Twhere U: TryFrom<T>,

§

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.