Struct euler::Quat
[−]
[src]
#[repr(C)]pub struct Quat { pub x: f32, pub y: f32, pub z: f32, pub s: f32, }
Single-precision quaternion.
Fields
x: f32
y: f32
z: f32
s: f32
Methods
impl Quat
[src]
fn new(x: f32, y: f32, z: f32, s: f32) -> Self
[src]
Full constructor.
fn identity() -> Self
[src]
Identity constructor.
fn euler(angles: Vec3) -> Self
[src]
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
.
fn axis_angle(axis: Vec3, angle: f32) -> Self
[src]
Constructor for a rotation around axis
by angle
radians.
axis
need not be normalized.
fn rotate(&self, vector: Vec3) -> Vec3
[src]
Return the application of the rotation represented by this quaternion to the vector argument.
Trait Implementations
impl Clone for Quat
[src]
fn clone(&self) -> Quat
[src]
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl Copy for Quat
[src]
impl Debug for Quat
[src]
impl PartialEq for Quat
[src]
fn eq(&self, __arg_0: &Quat) -> bool
[src]
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, __arg_0: &Quat) -> bool
[src]
This method tests for !=
.
impl Display for Quat
[src]
fn fmt(&self, f: &mut Formatter) -> Result
[src]
Formats the value using the given formatter. Read more
impl Mul<Quat> for Quat
[src]
type Output = Quat
The resulting type after applying the *
operator.
fn mul(self, rhs: Quat) -> Quat
[src]
Performs the *
operation.
impl MulAssign<Quat> for Quat
[src]
fn mul_assign(&mut self, rhs: Quat)
[src]
Performs the *=
operation.
impl Default for Quat
[src]
impl AsRef<[f32; 4]> for Quat
[src]
impl From<[f32; 4]> for Quat
[src]
impl Into<[f32; 4]> for Quat
[src]
impl ApproxEq for Quat
[src]
type Epsilon = <Quaternion<f32> as ApproxEq>::Epsilon
Used for specifying relative comparisons.
fn default_epsilon() -> Self::Epsilon
[src]
The default tolerance to use when testing values that are close together. Read more
fn default_max_relative() -> Self::Epsilon
[src]
The default relative tolerance for testing values that are far-apart. Read more
fn default_max_ulps() -> u32
[src]
The default ULPs to tolerate when testing values that are far-apart. Read more
fn relative_eq(
&self,
other: &Self,
epsilon: Self::Epsilon,
max_relative: Self::Epsilon
) -> bool
[src]
&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.
fn ulps_eq(&self, other: &Self, epsilon: Self::Epsilon, max_ulps: u32) -> bool
[src]
A test for equality that uses units in the last place (ULP) if the values are far apart.
fn relative_ne(
&self,
other: &Self,
epsilon: Self::Epsilon,
max_relative: Self::Epsilon
) -> bool
[src]
&self,
other: &Self,
epsilon: Self::Epsilon,
max_relative: Self::Epsilon
) -> bool
The inverse of ApproxEq::relative_eq
.
fn ulps_ne(&self, other: &Self, epsilon: Self::Epsilon, max_ulps: u32) -> bool
[src]
The inverse of ApproxEq::ulps_eq
.