pub struct Quaternion { /* private fields */ }Expand description
A quaternion representing a 3D rotation with x, y, z, and w components.
Implementations§
Source§impl Quaternion
Implements quaternion operations for Quaternion.
impl Quaternion
Implements quaternion operations for Quaternion.
Sourcepub fn identity() -> Quaternion
pub fn identity() -> Quaternion
Returns the identity quaternion (0, 0, 0, 1) representing no rotation.
§Returns
Quaternion- The identity quaternion.
Sourcepub fn from_axis_angle(axis: Vector3D, angle: f64) -> Quaternion
pub fn from_axis_angle(axis: Vector3D, angle: f64) -> Quaternion
Sourcepub fn from_euler(yaw: f64, pitch: f64, roll: f64) -> Quaternion
pub fn from_euler(yaw: f64, pitch: f64, roll: f64) -> Quaternion
Sourcepub fn normalized(&self) -> Quaternion
pub fn normalized(&self) -> Quaternion
Sourcepub fn conjugate(&self) -> Quaternion
pub fn conjugate(&self) -> Quaternion
Sourcepub fn dot(&self, other: Quaternion) -> f64
pub fn dot(&self, other: Quaternion) -> f64
Sourcepub fn slerp(&self, other: Quaternion, t: f64) -> Quaternion
pub fn slerp(&self, other: Quaternion, t: f64) -> Quaternion
Source§impl Quaternion
impl Quaternion
pub fn get_x(&self) -> f64
pub fn get_mut_x(&mut self) -> &mut f64
pub fn set_x(&mut self, val: f64) -> &mut Self
pub fn get_y(&self) -> f64
pub fn get_mut_y(&mut self) -> &mut f64
pub fn set_y(&mut self, val: f64) -> &mut Self
pub fn get_z(&self) -> f64
pub fn get_mut_z(&mut self) -> &mut f64
pub fn set_z(&mut self, val: f64) -> &mut Self
pub fn get_w(&self) -> f64
pub fn get_mut_w(&mut self) -> &mut f64
pub fn set_w(&mut self, val: f64) -> &mut Self
Trait Implementations§
Source§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 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for Quaternion
Source§impl Debug for Quaternion
impl Debug for Quaternion
Source§impl Default for Quaternion
Implements Default for Quaternion as the identity quaternion.
impl Default for Quaternion
Implements Default for Quaternion as the identity quaternion.
Source§fn default() -> Quaternion
fn default() -> Quaternion
Returns the “default value” for a type. Read more
Source§impl Mul for Quaternion
Implements quaternion multiplication.
impl Mul for Quaternion
Implements quaternion multiplication.
Source§type Output = Quaternion
type Output = Quaternion
The resulting type after applying the
* operator.Source§fn mul(self, other: Quaternion) -> Quaternion
fn mul(self, other: Quaternion) -> Quaternion
Performs the
* operation. Read moreSource§impl PartialEq for Quaternion
impl PartialEq for Quaternion
Source§fn eq(&self, other: &Quaternion) -> bool
fn eq(&self, other: &Quaternion) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl PartialOrd for Quaternion
impl PartialOrd 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 UnsafeUnpin 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