#[repr(C)]pub struct RigidTransform3D<T, Src, Dst> {
pub rotation: Rotation3D<T, Src, Dst>,
pub translation: Vector3D<T, Dst>,
}
Expand description
A rigid transformation. All lengths are preserved under such a transformation.
Internally, this is a rotation and a translation, with the rotation
applied first (i.e. Rotation * Translation
, in row-vector notation)
This can be more efficient to use over full matrices, especially if you have to deal with the decomposed quantities often.
Fields§
§rotation: Rotation3D<T, Src, Dst>
§translation: Vector3D<T, Dst>
Implementations§
Source§impl<T, Src, Dst> RigidTransform3D<T, Src, Dst>
impl<T, Src, Dst> RigidTransform3D<T, Src, Dst>
Sourcepub const fn new(
rotation: Rotation3D<T, Src, Dst>,
translation: Vector3D<T, Dst>,
) -> Self
pub const fn new( rotation: Rotation3D<T, Src, Dst>, translation: Vector3D<T, Dst>, ) -> Self
Construct a new rigid transformation, where the rotation
applies first
Source§impl<T: Copy, Src, Dst> RigidTransform3D<T, Src, Dst>
impl<T: Copy, Src, Dst> RigidTransform3D<T, Src, Dst>
pub fn cast_unit<Src2, Dst2>(&self) -> RigidTransform3D<T, Src2, Dst2>
Source§impl<T: Float + ApproxEq<T>, Src, Dst> RigidTransform3D<T, Src, Dst>
impl<T: Float + ApproxEq<T>, Src, Dst> RigidTransform3D<T, Src, Dst>
Sourcepub fn new_from_reversed(
translation: Vector3D<T, Src>,
rotation: Rotation3D<T, Src, Dst>,
) -> Self
pub fn new_from_reversed( translation: Vector3D<T, Src>, rotation: Rotation3D<T, Src, Dst>, ) -> Self
Construct a new rigid transformation, where the translation
applies first
pub fn from_rotation(rotation: Rotation3D<T, Src, Dst>) -> Self
pub fn from_translation(translation: Vector3D<T, Dst>) -> Self
Sourcepub fn decompose_reversed(&self) -> (Vector3D<T, Src>, Rotation3D<T, Src, Dst>)
pub fn decompose_reversed(&self) -> (Vector3D<T, Src>, Rotation3D<T, Src, Dst>)
Decompose this into a translation and an rotation to be applied in the opposite order
i.e., the translation is applied first
Sourcepub fn then<Dst2>(
&self,
other: &RigidTransform3D<T, Dst, Dst2>,
) -> RigidTransform3D<T, Src, Dst2>
pub fn then<Dst2>( &self, other: &RigidTransform3D<T, Dst, Dst2>, ) -> RigidTransform3D<T, Src, Dst2>
Returns the multiplication of the two transforms such that other’s transformation applies after self’s transformation.
i.e., this produces self * other
in row-vector notation
Sourcepub fn inverse(&self) -> RigidTransform3D<T, Dst, Src>
pub fn inverse(&self) -> RigidTransform3D<T, Dst, Src>
Inverts the transformation
pub fn to_transform(&self) -> Transform3D<T, Src, Dst>where
T: Trig,
Sourcepub fn to_untyped(&self) -> RigidTransform3D<T, UnknownUnit, UnknownUnit>
pub fn to_untyped(&self) -> RigidTransform3D<T, UnknownUnit, UnknownUnit>
Drop the units, preserving only the numeric value.
Sourcepub fn from_untyped(
transform: &RigidTransform3D<T, UnknownUnit, UnknownUnit>,
) -> Self
pub fn from_untyped( transform: &RigidTransform3D<T, UnknownUnit, UnknownUnit>, ) -> Self
Tag a unitless value with units.
Trait Implementations§
Source§impl<T: Clone, Src: Clone, Dst: Clone> Clone for RigidTransform3D<T, Src, Dst>
impl<T: Clone, Src: Clone, Dst: Clone> Clone for RigidTransform3D<T, Src, Dst>
Source§fn clone(&self) -> RigidTransform3D<T, Src, Dst>
fn clone(&self) -> RigidTransform3D<T, Src, Dst>
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl<'de, T, Src, Dst> Deserialize<'de> for RigidTransform3D<T, Src, Dst>
impl<'de, T, Src, Dst> Deserialize<'de> for RigidTransform3D<T, Src, Dst>
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>,
Source§impl<T: Float + ApproxEq<T>, Src, Dst> From<Rotation3D<T, Src, Dst>> for RigidTransform3D<T, Src, Dst>
impl<T: Float + ApproxEq<T>, Src, Dst> From<Rotation3D<T, Src, Dst>> for RigidTransform3D<T, Src, Dst>
Source§fn from(rot: Rotation3D<T, Src, Dst>) -> Self
fn from(rot: Rotation3D<T, Src, Dst>) -> Self
Source§impl<T: Float + ApproxEq<T>, Src, Dst> From<Vector3D<T, Dst>> for RigidTransform3D<T, Src, Dst>
impl<T: Float + ApproxEq<T>, Src, Dst> From<Vector3D<T, Dst>> for RigidTransform3D<T, Src, Dst>
Source§impl<T: PartialEq, Src: PartialEq, Dst: PartialEq> PartialEq for RigidTransform3D<T, Src, Dst>
impl<T: PartialEq, Src: PartialEq, Dst: PartialEq> PartialEq for RigidTransform3D<T, Src, Dst>
Source§fn eq(&self, other: &RigidTransform3D<T, Src, Dst>) -> bool
fn eq(&self, other: &RigidTransform3D<T, Src, Dst>) -> bool
self
and other
values to be equal, and is used by ==
.Source§impl<T, Src, Dst> Serialize for RigidTransform3D<T, Src, Dst>
impl<T, Src, Dst> Serialize for RigidTransform3D<T, Src, Dst>
impl<T: Copy, Src: Copy, Dst: Copy> Copy for RigidTransform3D<T, Src, Dst>
impl<T: Eq, Src: Eq, Dst: Eq> Eq for RigidTransform3D<T, Src, Dst>
impl<T, Src, Dst> StructuralPartialEq for RigidTransform3D<T, Src, Dst>
Auto Trait Implementations§
impl<T, Src, Dst> Freeze for RigidTransform3D<T, Src, Dst>where
T: Freeze,
impl<T, Src, Dst> RefUnwindSafe for RigidTransform3D<T, Src, Dst>
impl<T, Src, Dst> Send for RigidTransform3D<T, Src, Dst>
impl<T, Src, Dst> Sync for RigidTransform3D<T, Src, Dst>
impl<T, Src, Dst> Unpin for RigidTransform3D<T, Src, Dst>
impl<T, Src, Dst> UnwindSafe for RigidTransform3D<T, Src, Dst>
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
)