Struct slender_math::Quaternion
source · #[repr(C, align(16))]pub struct Quaternion(_);Expand description
A quaternion
Implementations§
source§impl Quaternion
impl Quaternion
sourcepub const fn new(x: f32, y: f32, z: f32, w: f32) -> Self
pub const fn new(x: f32, y: f32, z: f32, w: f32) -> Self
Creates a new quaternion from the given components
sourcepub const fn from_array(array: [f32; 4]) -> Self
pub const fn from_array(array: [f32; 4]) -> Self
Creates a new quaternion from the given array
sourcepub fn as_mut_array(&mut self) -> &mut [f32; 4]
pub fn as_mut_array(&mut self) -> &mut [f32; 4]
Returns a mutable array reference to the quaternion
sourcepub fn from_axis_angle(axis: Vector3f, angle: f32) -> Self
pub fn from_axis_angle(axis: Vector3f, angle: f32) -> Self
Creates a quaternion representing a rotation around an arbitrary axis
The axis vector must be normalized
sourcepub fn from_angle_x(angle: f32) -> Self
pub fn from_angle_x(angle: f32) -> Self
Creates a quaternion representing a rotation around the X axis
sourcepub fn from_angle_y(angle: f32) -> Self
pub fn from_angle_y(angle: f32) -> Self
Creates a quaternion representing a rotation around the Y axis
sourcepub fn from_angle_z(angle: f32) -> Self
pub fn from_angle_z(angle: f32) -> Self
Creates a quaternion representing a rotation around the Z axis
sourcepub fn from_yaw_pitch_roll(yaw: f32, pitch: f32, roll: f32) -> Self
pub fn from_yaw_pitch_roll(yaw: f32, pitch: f32, roll: f32) -> Self
Creates a quaternion representing a rotation specified by yaw, pitch and roll angles
sourcepub fn to_axis_angle(&self) -> (Vector3f, f32)
pub fn to_axis_angle(&self) -> (Vector3f, f32)
Converts the quaternion into an equivalent rotation around an axis
sourcepub fn normalized(self) -> Self
pub fn normalized(self) -> Self
Normalizes the quaternion
§impl Quaternion
impl Quaternion
pub fn xx(&self) -> Vector2f
pub fn xy(&self) -> Vector2f
pub fn xz(&self) -> Vector2f
pub fn xw(&self) -> Vector2f
pub fn yx(&self) -> Vector2f
pub fn yy(&self) -> Vector2f
pub fn yz(&self) -> Vector2f
pub fn yw(&self) -> Vector2f
pub fn zx(&self) -> Vector2f
pub fn zy(&self) -> Vector2f
pub fn zz(&self) -> Vector2f
pub fn zw(&self) -> Vector2f
pub fn wx(&self) -> Vector2f
pub fn wy(&self) -> Vector2f
pub fn wz(&self) -> Vector2f
pub fn ww(&self) -> Vector2f
pub fn xxx(&self) -> Vector3f
pub fn xxy(&self) -> Vector3f
pub fn xxz(&self) -> Vector3f
pub fn xxw(&self) -> Vector3f
pub fn xyx(&self) -> Vector3f
pub fn xyy(&self) -> Vector3f
pub fn xyz(&self) -> Vector3f
pub fn xyw(&self) -> Vector3f
pub fn xzx(&self) -> Vector3f
pub fn xzy(&self) -> Vector3f
pub fn xzz(&self) -> Vector3f
pub fn xzw(&self) -> Vector3f
pub fn xwx(&self) -> Vector3f
pub fn xwy(&self) -> Vector3f
pub fn xwz(&self) -> Vector3f
pub fn xww(&self) -> Vector3f
pub fn yxx(&self) -> Vector3f
pub fn yxy(&self) -> Vector3f
pub fn yxz(&self) -> Vector3f
pub fn yxw(&self) -> Vector3f
pub fn yyx(&self) -> Vector3f
pub fn yyy(&self) -> Vector3f
pub fn yyz(&self) -> Vector3f
pub fn yyw(&self) -> Vector3f
pub fn yzx(&self) -> Vector3f
pub fn yzy(&self) -> Vector3f
pub fn yzz(&self) -> Vector3f
pub fn yzw(&self) -> Vector3f
pub fn ywx(&self) -> Vector3f
pub fn ywy(&self) -> Vector3f
pub fn ywz(&self) -> Vector3f
pub fn yww(&self) -> Vector3f
pub fn zxx(&self) -> Vector3f
pub fn zxy(&self) -> Vector3f
pub fn zxz(&self) -> Vector3f
pub fn zxw(&self) -> Vector3f
pub fn zyx(&self) -> Vector3f
pub fn zyy(&self) -> Vector3f
pub fn zyz(&self) -> Vector3f
pub fn zyw(&self) -> Vector3f
pub fn zzx(&self) -> Vector3f
pub fn zzy(&self) -> Vector3f
pub fn zzz(&self) -> Vector3f
pub fn zzw(&self) -> Vector3f
pub fn zwx(&self) -> Vector3f
pub fn zwy(&self) -> Vector3f
pub fn zwz(&self) -> Vector3f
pub fn zww(&self) -> Vector3f
pub fn wxx(&self) -> Vector3f
pub fn wxy(&self) -> Vector3f
pub fn wxz(&self) -> Vector3f
pub fn wxw(&self) -> Vector3f
pub fn wyx(&self) -> Vector3f
pub fn wyy(&self) -> Vector3f
pub fn wyz(&self) -> Vector3f
pub fn wyw(&self) -> Vector3f
pub fn wzx(&self) -> Vector3f
pub fn wzy(&self) -> Vector3f
pub fn wzz(&self) -> Vector3f
pub fn wzw(&self) -> Vector3f
pub fn wwx(&self) -> Vector3f
pub fn wwy(&self) -> Vector3f
pub fn wwz(&self) -> Vector3f
pub fn www(&self) -> Vector3f
pub fn xxxx(&self) -> Vector4f
pub fn xxxy(&self) -> Vector4f
pub fn xxxz(&self) -> Vector4f
pub fn xxxw(&self) -> Vector4f
pub fn xxyx(&self) -> Vector4f
pub fn xxyy(&self) -> Vector4f
pub fn xxyz(&self) -> Vector4f
pub fn xxyw(&self) -> Vector4f
pub fn xxzx(&self) -> Vector4f
pub fn xxzy(&self) -> Vector4f
pub fn xxzz(&self) -> Vector4f
pub fn xxzw(&self) -> Vector4f
pub fn xxwx(&self) -> Vector4f
pub fn xxwy(&self) -> Vector4f
pub fn xxwz(&self) -> Vector4f
pub fn xxww(&self) -> Vector4f
pub fn xyxx(&self) -> Vector4f
pub fn xyxy(&self) -> Vector4f
pub fn xyxz(&self) -> Vector4f
pub fn xyxw(&self) -> Vector4f
pub fn xyyx(&self) -> Vector4f
pub fn xyyy(&self) -> Vector4f
pub fn xyyz(&self) -> Vector4f
pub fn xyyw(&self) -> Vector4f
pub fn xyzx(&self) -> Vector4f
pub fn xyzy(&self) -> Vector4f
pub fn xyzz(&self) -> Vector4f
pub fn xyzw(&self) -> Vector4f
pub fn xywx(&self) -> Vector4f
pub fn xywy(&self) -> Vector4f
pub fn xywz(&self) -> Vector4f
pub fn xyww(&self) -> Vector4f
pub fn xzxx(&self) -> Vector4f
pub fn xzxy(&self) -> Vector4f
pub fn xzxz(&self) -> Vector4f
pub fn xzxw(&self) -> Vector4f
pub fn xzyx(&self) -> Vector4f
pub fn xzyy(&self) -> Vector4f
pub fn xzyz(&self) -> Vector4f
pub fn xzyw(&self) -> Vector4f
pub fn xzzx(&self) -> Vector4f
pub fn xzzy(&self) -> Vector4f
pub fn xzzz(&self) -> Vector4f
pub fn xzzw(&self) -> Vector4f
pub fn xzwx(&self) -> Vector4f
pub fn xzwy(&self) -> Vector4f
pub fn xzwz(&self) -> Vector4f
pub fn xzww(&self) -> Vector4f
pub fn xwxx(&self) -> Vector4f
pub fn xwxy(&self) -> Vector4f
pub fn xwxz(&self) -> Vector4f
pub fn xwxw(&self) -> Vector4f
pub fn xwyx(&self) -> Vector4f
pub fn xwyy(&self) -> Vector4f
pub fn xwyz(&self) -> Vector4f
pub fn xwyw(&self) -> Vector4f
pub fn xwzx(&self) -> Vector4f
pub fn xwzy(&self) -> Vector4f
pub fn xwzz(&self) -> Vector4f
pub fn xwzw(&self) -> Vector4f
pub fn xwwx(&self) -> Vector4f
pub fn xwwy(&self) -> Vector4f
pub fn xwwz(&self) -> Vector4f
pub fn xwww(&self) -> Vector4f
pub fn yxxx(&self) -> Vector4f
pub fn yxxy(&self) -> Vector4f
pub fn yxxz(&self) -> Vector4f
pub fn yxxw(&self) -> Vector4f
pub fn yxyx(&self) -> Vector4f
pub fn yxyy(&self) -> Vector4f
pub fn yxyz(&self) -> Vector4f
pub fn yxyw(&self) -> Vector4f
pub fn yxzx(&self) -> Vector4f
pub fn yxzy(&self) -> Vector4f
pub fn yxzz(&self) -> Vector4f
pub fn yxzw(&self) -> Vector4f
pub fn yxwx(&self) -> Vector4f
pub fn yxwy(&self) -> Vector4f
pub fn yxwz(&self) -> Vector4f
pub fn yxww(&self) -> Vector4f
pub fn yyxx(&self) -> Vector4f
pub fn yyxy(&self) -> Vector4f
pub fn yyxz(&self) -> Vector4f
pub fn yyxw(&self) -> Vector4f
pub fn yyyx(&self) -> Vector4f
pub fn yyyy(&self) -> Vector4f
pub fn yyyz(&self) -> Vector4f
pub fn yyyw(&self) -> Vector4f
pub fn yyzx(&self) -> Vector4f
pub fn yyzy(&self) -> Vector4f
pub fn yyzz(&self) -> Vector4f
pub fn yyzw(&self) -> Vector4f
pub fn yywx(&self) -> Vector4f
pub fn yywy(&self) -> Vector4f
pub fn yywz(&self) -> Vector4f
pub fn yyww(&self) -> Vector4f
pub fn yzxx(&self) -> Vector4f
pub fn yzxy(&self) -> Vector4f
pub fn yzxz(&self) -> Vector4f
pub fn yzxw(&self) -> Vector4f
pub fn yzyx(&self) -> Vector4f
pub fn yzyy(&self) -> Vector4f
pub fn yzyz(&self) -> Vector4f
pub fn yzyw(&self) -> Vector4f
pub fn yzzx(&self) -> Vector4f
pub fn yzzy(&self) -> Vector4f
pub fn yzzz(&self) -> Vector4f
pub fn yzzw(&self) -> Vector4f
pub fn yzwx(&self) -> Vector4f
pub fn yzwy(&self) -> Vector4f
pub fn yzwz(&self) -> Vector4f
pub fn yzww(&self) -> Vector4f
pub fn ywxx(&self) -> Vector4f
pub fn ywxy(&self) -> Vector4f
pub fn ywxz(&self) -> Vector4f
pub fn ywxw(&self) -> Vector4f
pub fn ywyx(&self) -> Vector4f
pub fn ywyy(&self) -> Vector4f
pub fn ywyz(&self) -> Vector4f
pub fn ywyw(&self) -> Vector4f
pub fn ywzx(&self) -> Vector4f
pub fn ywzy(&self) -> Vector4f
pub fn ywzz(&self) -> Vector4f
pub fn ywzw(&self) -> Vector4f
pub fn ywwx(&self) -> Vector4f
pub fn ywwy(&self) -> Vector4f
pub fn ywwz(&self) -> Vector4f
pub fn ywww(&self) -> Vector4f
pub fn zxxx(&self) -> Vector4f
pub fn zxxy(&self) -> Vector4f
pub fn zxxz(&self) -> Vector4f
pub fn zxxw(&self) -> Vector4f
pub fn zxyx(&self) -> Vector4f
pub fn zxyy(&self) -> Vector4f
pub fn zxyz(&self) -> Vector4f
pub fn zxyw(&self) -> Vector4f
pub fn zxzx(&self) -> Vector4f
pub fn zxzy(&self) -> Vector4f
pub fn zxzz(&self) -> Vector4f
pub fn zxzw(&self) -> Vector4f
pub fn zxwx(&self) -> Vector4f
pub fn zxwy(&self) -> Vector4f
pub fn zxwz(&self) -> Vector4f
pub fn zxww(&self) -> Vector4f
pub fn zyxx(&self) -> Vector4f
pub fn zyxy(&self) -> Vector4f
pub fn zyxz(&self) -> Vector4f
pub fn zyxw(&self) -> Vector4f
pub fn zyyx(&self) -> Vector4f
pub fn zyyy(&self) -> Vector4f
pub fn zyyz(&self) -> Vector4f
pub fn zyyw(&self) -> Vector4f
pub fn zyzx(&self) -> Vector4f
pub fn zyzy(&self) -> Vector4f
pub fn zyzz(&self) -> Vector4f
pub fn zyzw(&self) -> Vector4f
pub fn zywx(&self) -> Vector4f
pub fn zywy(&self) -> Vector4f
pub fn zywz(&self) -> Vector4f
pub fn zyww(&self) -> Vector4f
pub fn zzxx(&self) -> Vector4f
pub fn zzxy(&self) -> Vector4f
pub fn zzxz(&self) -> Vector4f
pub fn zzxw(&self) -> Vector4f
pub fn zzyx(&self) -> Vector4f
pub fn zzyy(&self) -> Vector4f
pub fn zzyz(&self) -> Vector4f
pub fn zzyw(&self) -> Vector4f
pub fn zzzx(&self) -> Vector4f
pub fn zzzy(&self) -> Vector4f
pub fn zzzz(&self) -> Vector4f
pub fn zzzw(&self) -> Vector4f
pub fn zzwx(&self) -> Vector4f
pub fn zzwy(&self) -> Vector4f
pub fn zzwz(&self) -> Vector4f
pub fn zzww(&self) -> Vector4f
pub fn zwxx(&self) -> Vector4f
pub fn zwxy(&self) -> Vector4f
pub fn zwxz(&self) -> Vector4f
pub fn zwxw(&self) -> Vector4f
pub fn zwyx(&self) -> Vector4f
pub fn zwyy(&self) -> Vector4f
pub fn zwyz(&self) -> Vector4f
pub fn zwyw(&self) -> Vector4f
pub fn zwzx(&self) -> Vector4f
pub fn zwzy(&self) -> Vector4f
pub fn zwzz(&self) -> Vector4f
pub fn zwzw(&self) -> Vector4f
pub fn zwwx(&self) -> Vector4f
pub fn zwwy(&self) -> Vector4f
pub fn zwwz(&self) -> Vector4f
pub fn zwww(&self) -> Vector4f
pub fn wxxx(&self) -> Vector4f
pub fn wxxy(&self) -> Vector4f
pub fn wxxz(&self) -> Vector4f
pub fn wxxw(&self) -> Vector4f
pub fn wxyx(&self) -> Vector4f
pub fn wxyy(&self) -> Vector4f
pub fn wxyz(&self) -> Vector4f
pub fn wxyw(&self) -> Vector4f
pub fn wxzx(&self) -> Vector4f
pub fn wxzy(&self) -> Vector4f
pub fn wxzz(&self) -> Vector4f
pub fn wxzw(&self) -> Vector4f
pub fn wxwx(&self) -> Vector4f
pub fn wxwy(&self) -> Vector4f
pub fn wxwz(&self) -> Vector4f
pub fn wxww(&self) -> Vector4f
pub fn wyxx(&self) -> Vector4f
pub fn wyxy(&self) -> Vector4f
pub fn wyxz(&self) -> Vector4f
pub fn wyxw(&self) -> Vector4f
pub fn wyyx(&self) -> Vector4f
pub fn wyyy(&self) -> Vector4f
pub fn wyyz(&self) -> Vector4f
pub fn wyyw(&self) -> Vector4f
pub fn wyzx(&self) -> Vector4f
pub fn wyzy(&self) -> Vector4f
pub fn wyzz(&self) -> Vector4f
pub fn wyzw(&self) -> Vector4f
pub fn wywx(&self) -> Vector4f
pub fn wywy(&self) -> Vector4f
pub fn wywz(&self) -> Vector4f
pub fn wyww(&self) -> Vector4f
pub fn wzxx(&self) -> Vector4f
pub fn wzxy(&self) -> Vector4f
pub fn wzxz(&self) -> Vector4f
pub fn wzxw(&self) -> Vector4f
pub fn wzyx(&self) -> Vector4f
pub fn wzyy(&self) -> Vector4f
pub fn wzyz(&self) -> Vector4f
pub fn wzyw(&self) -> Vector4f
pub fn wzzx(&self) -> Vector4f
pub fn wzzy(&self) -> Vector4f
pub fn wzzz(&self) -> Vector4f
pub fn wzzw(&self) -> Vector4f
pub fn wzwx(&self) -> Vector4f
pub fn wzwy(&self) -> Vector4f
pub fn wzwz(&self) -> Vector4f
pub fn wzww(&self) -> Vector4f
pub fn wwxx(&self) -> Vector4f
pub fn wwxy(&self) -> Vector4f
pub fn wwxz(&self) -> Vector4f
pub fn wwxw(&self) -> Vector4f
pub fn wwyx(&self) -> Vector4f
pub fn wwyy(&self) -> Vector4f
pub fn wwyz(&self) -> Vector4f
pub fn wwyw(&self) -> Vector4f
pub fn wwzx(&self) -> Vector4f
pub fn wwzy(&self) -> Vector4f
pub fn wwzz(&self) -> Vector4f
pub fn wwzw(&self) -> Vector4f
pub fn wwwx(&self) -> Vector4f
pub fn wwwy(&self) -> Vector4f
pub fn wwwz(&self) -> Vector4f
pub fn wwww(&self) -> Vector4f
Trait Implementations§
source§impl Add<Quaternion> for Quaternion
impl Add<Quaternion> for Quaternion
source§impl AddAssign<Quaternion> for Quaternion
impl AddAssign<Quaternion> for Quaternion
source§fn add_assign(&mut self, rhs: Self)
fn add_assign(&mut self, rhs: Self)
Performs the
+= operation. Read moresource§impl Clone for Quaternion
impl Clone for Quaternion
source§fn clone(&self) -> Quaternion
fn clone(&self) -> Quaternion
Returns a copy 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 Display for Quaternion
impl Display for Quaternion
source§impl Div<f32> for Quaternion
impl Div<f32> for Quaternion
source§impl DivAssign<f32> for Quaternion
impl DivAssign<f32> for Quaternion
source§fn div_assign(&mut self, rhs: f32)
fn div_assign(&mut self, rhs: f32)
Performs the
/= operation. Read moresource§impl Index<usize> for Quaternion
impl Index<usize> for Quaternion
source§impl IndexMut<usize> for Quaternion
impl IndexMut<usize> for Quaternion
source§impl Mul<Quaternion> for Quaternion
impl Mul<Quaternion> for Quaternion
source§impl Mul<Vector3f> for Quaternion
impl Mul<Vector3f> for Quaternion
source§impl Mul<f32> for Quaternion
impl Mul<f32> for Quaternion
source§impl MulAssign<Quaternion> for Quaternion
impl MulAssign<Quaternion> for Quaternion
source§fn mul_assign(&mut self, rhs: Self)
fn mul_assign(&mut self, rhs: Self)
Performs the
*= operation. Read moresource§impl MulAssign<f32> for Quaternion
impl MulAssign<f32> for Quaternion
source§fn mul_assign(&mut self, rhs: f32)
fn mul_assign(&mut self, rhs: f32)
Performs the
*= operation. Read moresource§impl Neg for Quaternion
impl Neg for Quaternion
source§impl PartialEq<Quaternion> for Quaternion
impl PartialEq<Quaternion> for Quaternion
source§fn eq(&self, other: &Quaternion) -> bool
fn eq(&self, other: &Quaternion) -> bool
This method tests for
self and other values to be equal, and is used
by ==.source§impl Sub<Quaternion> for Quaternion
impl Sub<Quaternion> for Quaternion
source§impl SubAssign<Quaternion> for Quaternion
impl SubAssign<Quaternion> for Quaternion
source§fn sub_assign(&mut self, rhs: Self)
fn sub_assign(&mut self, rhs: Self)
Performs the
-= operation. Read moreimpl Copy for Quaternion
impl Pod for Quaternion
impl StructuralPartialEq for Quaternion
Auto Trait Implementations§
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> CheckedBitPattern for Twhere
T: AnyBitPattern,
impl<T> CheckedBitPattern for Twhere T: AnyBitPattern,
§type Bits = T
type Bits = T
Self must have the same layout as the specified Bits except for
the possible invalid bit patterns being checked during
is_valid_bit_pattern.source§fn is_valid_bit_pattern(_bits: &T) -> bool
fn is_valid_bit_pattern(_bits: &T) -> bool
If this function returns true, then it must be valid to reinterpret
bits
as &Self.