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