pub struct Quaternion {
pub x: Float,
pub y: Float,
pub z: Float,
pub w: Float,
}
Fields§
§x: Float
§y: Float
§z: Float
§w: Float
Implementations§
Source§impl Quaternion
impl Quaternion
pub fn new(x: Float, y: Float, z: Float, w: Float) -> Self
pub fn identity() -> Self
pub fn normalize(&self) -> Self
pub fn dot(&self, q2: &Quaternion) -> Float
pub fn slerp(t: Float, q1: &Quaternion, q2: &Quaternion) -> Quaternion
pub fn to_matrix(&self) -> Matrix4x4
pub fn from_angle_axis(theta: Float, axis: &Vector3f) -> Self
pub fn from_matrix(m: &Matrix4x4) -> Self
Trait Implementations§
Source§impl Add for Quaternion
impl Add for Quaternion
Source§type Output = Quaternion
type Output = Quaternion
The resulting type after applying the
+
operator.Source§fn add(self, rhs: Quaternion) -> Quaternion
fn add(self, rhs: Quaternion) -> Quaternion
Performs the
+
operation. Read moreSource§impl Clone for Quaternion
impl Clone for Quaternion
Source§fn clone(&self) -> Quaternion
fn clone(&self) -> Quaternion
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for Quaternion
impl Debug for Quaternion
Source§impl Default for Quaternion
impl Default for Quaternion
Source§fn default() -> Quaternion
fn default() -> Quaternion
Returns the “default value” for a type. Read more
Source§impl From<Matrix4x4> for Quaternion
impl From<Matrix4x4> for Quaternion
Source§impl Mul<f32> for Quaternion
impl Mul<f32> for Quaternion
Source§type Output = Quaternion
type Output = Quaternion
The resulting type after applying the
*
operator.Source§impl Neg for Quaternion
impl Neg for Quaternion
Source§type Output = Quaternion
type Output = Quaternion
The resulting type after applying the
-
operator.Source§fn neg(self) -> Quaternion
fn neg(self) -> Quaternion
Performs the unary
-
operation. Read moreSource§impl PartialEq for Quaternion
impl PartialEq for Quaternion
Source§impl Sub for Quaternion
impl Sub for Quaternion
Source§type Output = Quaternion
type Output = Quaternion
The resulting type after applying the
-
operator.Source§fn sub(self, rhs: Quaternion) -> Quaternion
fn sub(self, rhs: Quaternion) -> Quaternion
Performs the
-
operation. Read moreimpl Copy for Quaternion
impl StructuralPartialEq for Quaternion
Auto Trait Implementations§
impl Freeze for Quaternion
impl RefUnwindSafe for Quaternion
impl Send for Quaternion
impl Sync for Quaternion
impl Unpin for Quaternion
impl UnwindSafe for Quaternion
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<R, P> ReadPrimitive<R> for P
impl<R, P> ReadPrimitive<R> for P
Source§fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
Read this value from the supplied reader. Same as
ReadEndian::read_from_little_endian()
.