Struct octoon_math::quat::Quat
source · pub struct Quat<T> {
pub x: T,
pub y: T,
pub z: T,
pub w: T,
}Fields
x: Ty: Tz: Tw: TImplementations
sourceimpl<T> Quat<T>where
T: Vec + Math,
impl<T> Quat<T>where
T: Vec + Math,
pub fn rotation_x(theta: T) -> Self
pub fn rotation_y(theta: T) -> Self
pub fn rotation_z(theta: T) -> Self
pub fn rotation(axis: &Vec3<T>, theta: T) -> Self
pub fn from_xyz(euler: &Vec3<T>) -> Self
pub fn from_zxy(euler: &Vec3<T>) -> Self
pub fn from_vectors(a: &Vec3<T>, b: &Vec3<T>) -> Self
pub fn dot(&self, b: Self) -> T
pub fn cross(&self, b: Self) -> Self
pub fn length2(&self) -> T
pub fn length(&self) -> T
pub fn distance(&self, b: Self) -> T
pub fn normalize(&self) -> Self
pub fn axis(&self) -> Vec3<T>
pub fn angle(&self) -> T
pub fn conjugate(&self) -> Self
pub fn inverse(&self) -> Self
Trait Implementations
sourceimpl<T> AddAssign<Quat<T>> for Quat<T>where
T: AddAssign<T>,
impl<T> AddAssign<Quat<T>> for Quat<T>where
T: AddAssign<T>,
sourcefn add_assign(&mut self, other: Self)
fn add_assign(&mut self, other: Self)
Performs the
+= operation. Read moresourceimpl<T> DivAssign<Quat<T>> for Quat<T>where
T: DivAssign<T>,
impl<T> DivAssign<Quat<T>> for Quat<T>where
T: DivAssign<T>,
sourcefn div_assign(&mut self, other: Self)
fn div_assign(&mut self, other: Self)
Performs the
/= operation. Read moresourceimpl<T> DivAssign<T> for Quat<T>where
T: DivAssign<T> + Copy,
impl<T> DivAssign<T> for Quat<T>where
T: DivAssign<T> + Copy,
sourcefn div_assign(&mut self, s: T)
fn div_assign(&mut self, s: T)
Performs the
/= operation. Read moresourceimpl<T> Interpolation<T> for Quat<T>where
T: Copy + One + Mul<Output = T> + Add<Output = T> + Sub<Output = T>,
impl<T> Interpolation<T> for Quat<T>where
T: Copy + One + Mul<Output = T> + Add<Output = T> + Sub<Output = T>,
sourceimpl<T> Math for Quat<T>where
T: Copy + Math,
impl<T> Math for Quat<T>where
T: Copy + Math,
fn abs(self) -> Self
fn recip(self) -> Self
fn sqrt(self) -> Self
fn rsqrt(self) -> Self
fn sin(self) -> Self
fn cos(self) -> Self
fn tan(self) -> Self
fn sincos(self) -> (Quat<T>, Quat<T>)
fn acos(self) -> Self
fn asin(self) -> Self
fn atan(self) -> Self
fn exp(self) -> Self
fn exp2(self) -> Self
fn log(self, _rhs: Self) -> Self
fn log2(self) -> Self
fn log10(self) -> Self
fn to_radians(self) -> Self
fn to_degrees(self) -> Self
fn min(self, _rhs: Self) -> Self
fn max(self, _rhs: Self) -> Self
fn saturate(self) -> Self
fn clamp(self, minval: Self, maxval: Self) -> Self
sourceimpl<T> MulAssign<Quat<T>> for Quat<T>where
T: MulAssign<T>,
impl<T> MulAssign<Quat<T>> for Quat<T>where
T: MulAssign<T>,
sourcefn mul_assign(&mut self, other: Self)
fn mul_assign(&mut self, other: Self)
Performs the
*= operation. Read moresourceimpl<T> MulAssign<T> for Quat<T>where
T: MulAssign<T> + Copy,
impl<T> MulAssign<T> for Quat<T>where
T: MulAssign<T> + Copy,
sourcefn mul_assign(&mut self, s: T)
fn mul_assign(&mut self, s: T)
Performs the
*= operation. Read moresourceimpl<T> SubAssign<Quat<T>> for Quat<T>where
T: SubAssign<T>,
impl<T> SubAssign<Quat<T>> for Quat<T>where
T: SubAssign<T>,
sourcefn sub_assign(&mut self, other: Self)
fn sub_assign(&mut self, other: Self)
Performs the
-= operation. Read moreimpl<T: Copy> Copy for Quat<T>
impl<T: Eq> Eq for Quat<T>
impl<T> StructuralEq for Quat<T>
impl<T> StructuralPartialEq for Quat<T>
Auto Trait Implementations
impl<T> RefUnwindSafe for Quat<T>where
T: RefUnwindSafe,
impl<T> Send for Quat<T>where
T: Send,
impl<T> Sync for Quat<T>where
T: Sync,
impl<T> Unpin for Quat<T>where
T: Unpin,
impl<T> UnwindSafe for Quat<T>where
T: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more