#[repr(C)]pub struct Quat {
pub x: f32,
pub y: f32,
pub z: f32,
pub s: f32,
}
Expand description
Single-precision quaternion.
Fields§
§x: f32
§y: f32
§z: f32
§s: f32
Implementations§
Source§impl Quat
impl Quat
Sourcepub fn euler(angles: Vec3) -> Self
pub fn euler(angles: Vec3) -> 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
.
Sourcepub fn axis_angle(axis: Vec3, angle: f32) -> Self
pub fn axis_angle(axis: Vec3, angle: f32) -> Self
Constructor for a rotation around axis
by angle
radians.
axis
need not be normalized.
Trait Implementations§
Source§impl ApproxEq for Quat
impl ApproxEq for Quat
Source§type Epsilon = <Quaternion<f32> as ApproxEq>::Epsilon
type Epsilon = <Quaternion<f32> as ApproxEq>::Epsilon
Used for specifying relative comparisons.
Source§fn default_epsilon() -> Self::Epsilon
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
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
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
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
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§impl MulAssign for Quat
impl MulAssign for Quat
Source§fn mul_assign(&mut self, rhs: Quat)
fn mul_assign(&mut self, rhs: Quat)
Performs the
*=
operation. Read moreimpl Copy for Quat
impl StructuralPartialEq for Quat
Auto Trait Implementations§
impl Freeze for Quat
impl RefUnwindSafe for Quat
impl Send for Quat
impl Sync for Quat
impl Unpin for Quat
impl UnwindSafe for Quat
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more