#[repr(C)]pub struct DualQuaternion { /* private fields */ }Expand description
A dual-quaternion represents both translations and rotations in a combined format.
Implementations§
source§impl DualQuaternion
impl DualQuaternion
sourcepub const fn new(real: Quaternion, dual: Quaternion) -> Self
pub const fn new(real: Quaternion, dual: Quaternion) -> Self
Creates a new dual quaternion from a real and dual quaternion.
§Parameters
real- The real part of the dual quaternion.dual- The dual part of the dual quaternion.
sourcepub const fn identity() -> Self
pub const fn identity() -> Self
Constructs a new dual quaternion with the identity rotation and no translation.
sourcepub const fn from_rotation(rotation: Quaternion) -> Self
pub const fn from_rotation(rotation: Quaternion) -> Self
Constructs this dual quaternion from a rotation quaternion.
§Parameters
rotation- The rotation quaternion to construct the dual quaternion from.
sourcepub fn from_pitch<A: Angle>(angle: A) -> Self
pub fn from_pitch<A: Angle>(angle: A) -> Self
sourcepub fn from_translation(translation: &Vec3) -> Self
pub fn from_translation(translation: &Vec3) -> Self
Constructs this dual quaternion from a translation vector.
§Parameters
translation- The translation vector to construct the dual quaternion from.
source§impl DualQuaternion
impl DualQuaternion
sourcepub fn to_matrix4(&self) -> Matrix4
pub fn to_matrix4(&self) -> Matrix4
Returns the transform matrix representation of the quaternion.
source§impl DualQuaternion
impl DualQuaternion
sourcepub const fn real(&self) -> &Quaternion
pub const fn real(&self) -> &Quaternion
Returns the real part of the dual quaternion.
sourcepub const fn dual(&self) -> &Quaternion
pub const fn dual(&self) -> &Quaternion
Returns the dual part of the dual quaternion.
sourcepub fn translation(&self) -> Vector3
pub fn translation(&self) -> Vector3
Returns the translation component in local-space.
sourcepub fn world_translation(&self) -> Vector3
pub fn world_translation(&self) -> Vector3
Returns the translation of the dual quaternion in world-space.
sourcepub const fn rotation(&self) -> &Quaternion
pub const fn rotation(&self) -> &Quaternion
Returns the rotation component of the dual quaternion.
sourcepub fn normalized(&self) -> DualQuaternion
pub fn normalized(&self) -> DualQuaternion
Returns a normalized DualQuaternion.
sourcepub fn conjugate(&self) -> DualQuaternion
pub fn conjugate(&self) -> DualQuaternion
Returns the conjugate of the dual quaternion.
source§impl DualQuaternion
impl DualQuaternion
sourcepub fn translate_world(&mut self, translation: &Vec3)
pub fn translate_world(&mut self, translation: &Vec3)
Translates the dual quaternion by the given vector in world space.
§Parameters
translation- The translation vector to apply to the dual quaternion.
sourcepub fn translate(&mut self, translation: &Vec3)
pub fn translate(&mut self, translation: &Vec3)
Translates the dual quaternion by the given vector in local space.
This will translate relative to the orientation of the dual quaternion.
§Parameters
translation- The translation vector to apply to the dual quaternion.
sourcepub fn rotate(&mut self, rotation: &Quaternion)
pub fn rotate(&mut self, rotation: &Quaternion)
Rotates the dual quaternion by the given angle.
sourcepub fn rotate_yaw<A: Angle>(&mut self, angle: A)
pub fn rotate_yaw<A: Angle>(&mut self, angle: A)
Rotates the dual quaternion by the given angle around the x-axis.
sourcepub fn rotate_pitch<A: Angle>(&mut self, angle: A)
pub fn rotate_pitch<A: Angle>(&mut self, angle: A)
Rotates the dual quaternion by the given angle around the y-axis.
sourcepub fn rotate_roll<A: Angle>(&mut self, angle: A)
pub fn rotate_roll<A: Angle>(&mut self, angle: A)
Rotates the dual quaternion by the given angle around the z-axis.
Trait Implementations§
source§impl Add for DualQuaternion
impl Add for DualQuaternion
source§impl Clone for DualQuaternion
impl Clone for DualQuaternion
source§fn clone(&self) -> DualQuaternion
fn clone(&self) -> DualQuaternion
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moresource§impl Debug for DualQuaternion
impl Debug for DualQuaternion
source§impl Mul for DualQuaternion
impl Mul for DualQuaternion
source§impl PartialEq for DualQuaternion
impl PartialEq for DualQuaternion
impl Copy for DualQuaternion
impl StructuralPartialEq for DualQuaternion
Auto Trait Implementations§
impl Freeze for DualQuaternion
impl RefUnwindSafe for DualQuaternion
impl Send for DualQuaternion
impl Sync for DualQuaternion
impl Unpin for DualQuaternion
impl UnwindSafe for DualQuaternion
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit)