#[repr(C)]pub struct Rigid {
pub rotation: Quat,
pub translation: Vec3,
}Expand description
Rigid transformation as rotation followed by translation, i.e., a direct isometry.
Implements Default and can be created with Rigid::default() returning Self::IDENTITY.
Fields§
§rotation: QuatRotational part.
translation: Vec3Translational part.
Implementations§
Source§impl Rigid
impl Rigid
Sourcepub const fn from_rotation_translation(
rotation: Quat,
translation: Vec3,
) -> Self
pub const fn from_rotation_translation( rotation: Quat, translation: Vec3, ) -> Self
Rigid transformation from rotation followed by translation.
Sourcepub fn transform_point(&self, point: Vec3) -> Vec3
pub fn transform_point(&self, point: Vec3) -> Vec3
Transforms point.
Sourcepub fn transform_vector(&self, vector: Vec3) -> Vec3
pub fn transform_vector(&self, vector: Vec3) -> Vec3
Transforms vector, i.e., rotation only.
Sourcepub fn abs_diff_eq(&self, other: Self, max_abs_diff: f32) -> bool
pub fn abs_diff_eq(&self, other: Self, max_abs_diff: f32) -> bool
Whether all components are approximately equal within absolute difference max_abs_diff.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Rigid
impl<'de> Deserialize<'de> for Rigid
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl MulAssign for Rigid
impl MulAssign for Rigid
Source§fn mul_assign(&mut self, rhs: Self)
fn mul_assign(&mut self, rhs: Self)
Performs the
*= operation. Read moreimpl Copy for Rigid
impl StructuralPartialEq for Rigid
Auto Trait Implementations§
impl Freeze for Rigid
impl RefUnwindSafe for Rigid
impl Send for Rigid
impl Sync for Rigid
impl Unpin for Rigid
impl UnsafeUnpin for Rigid
impl UnwindSafe for Rigid
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