pub struct Quaternion {
pub w: f64,
pub x: f64,
pub y: f64,
pub z: f64,
}Fields§
§w: f64§x: f64§y: f64§z: f64Implementations§
Source§impl Quaternion
impl Quaternion
pub fn new(w: f64, x: f64, y: f64, z: f64) -> Self
pub fn identity() -> Self
pub fn zero() -> Self
pub fn pure(x: f64, y: f64, z: f64) -> Self
pub fn from_axis_angle(axis: [f64; 3], angle: f64) -> Self
pub fn from_euler(roll: f64, pitch: f64, yaw: f64) -> Self
pub fn to_axis_angle(&self) -> ([f64; 3], f64)
pub fn to_rotation_matrix(&self) -> [[f64; 3]; 3]
pub fn conj(&self) -> Self
pub fn norm_sq(&self) -> f64
pub fn norm(&self) -> f64
pub fn normalize(&self) -> Self
pub fn inv(&self) -> Self
pub fn rotate_vector(&self, v: [f64; 3]) -> [f64; 3]
pub fn dot(&self, other: &Self) -> f64
pub fn slerp(&self, other: &Self, t: f64) -> Self
pub fn scale(&self, s: f64) -> Self
pub fn exp(&self) -> Self
pub fn ln(&self) -> Self
Trait Implementations§
Source§impl Add for Quaternion
impl Add for Quaternion
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 moreSource§impl Debug for Quaternion
impl Debug for Quaternion
Source§impl Display for Quaternion
impl Display for Quaternion
Source§impl Div for Quaternion
impl Div for Quaternion
Source§impl Mul for Quaternion
impl Mul for Quaternion
Source§impl Neg for Quaternion
impl Neg for Quaternion
Source§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 Sub for Quaternion
impl Sub for Quaternion
impl 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 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