Struct euclid::RigidTransform3D

source ·
#[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>

source

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>

source

pub fn cast_unit<Src2, Dst2>(&self) -> RigidTransform3D<T, Src2, Dst2>

source§

impl<T: Real + ApproxEq<T>, Src, Dst> RigidTransform3D<T, Src, Dst>

source

pub fn identity() -> Self

Construct an identity transform

source

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

source

pub fn from_rotation(rotation: Rotation3D<T, Src, Dst>) -> Self

source

pub fn from_translation(translation: Vector3D<T, Dst>) -> Self

source

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

source

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

source

pub fn inverse(&self) -> RigidTransform3D<T, Dst, Src>

Inverts the transformation

source

pub fn to_transform(&self) -> Transform3D<T, Src, Dst>
where T: Trig,

source

pub fn to_untyped(&self) -> RigidTransform3D<T, UnknownUnit, UnknownUnit>

Drop the units, preserving only the numeric value.

source

pub fn from_untyped( transform: &RigidTransform3D<T, UnknownUnit, UnknownUnit>, ) -> Self

Tag a unitless value with units.

Trait Implementations§

source§

impl<T: Clone, Src, Dst> Clone for RigidTransform3D<T, Src, Dst>

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<T: Debug, Src, Dst> Debug for RigidTransform3D<T, Src, Dst>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<'de, T, Src, Dst> Deserialize<'de> for RigidTransform3D<T, Src, Dst>
where T: Deserialize<'de>, Src: Deserialize<'de>, Dst: Deserialize<'de>,

source§

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<T: Real + ApproxEq<T>, Src, Dst> From<Rotation3D<T, Src, Dst>> for RigidTransform3D<T, Src, Dst>

source§

fn from(rot: Rotation3D<T, Src, Dst>) -> Self

Converts to this type from the input type.
source§

impl<T: Real + ApproxEq<T>, Src, Dst> From<Vector3D<T, Dst>> for RigidTransform3D<T, Src, Dst>

source§

fn from(t: Vector3D<T, Dst>) -> Self

Converts to this type from the input type.
source§

impl<T: Hash, Src, Dst> Hash for RigidTransform3D<T, Src, Dst>

source§

fn hash<H: Hasher>(&self, state: &mut H)

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl<T: PartialEq, Src, Dst> PartialEq for RigidTransform3D<T, Src, Dst>

source§

fn eq(&self, other: &Self) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl<T, Src, Dst> Serialize for RigidTransform3D<T, Src, Dst>
where T: Serialize, Src: Serialize, Dst: Serialize,

source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
source§

impl<T: Copy, Src, Dst> Copy for RigidTransform3D<T, Src, Dst>

source§

impl<T: Eq, Src, Dst> Eq 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>
where T: Send, Dst: Send, Src: Send,

§

impl<T, Src, Dst> Sync for RigidTransform3D<T, Src, Dst>
where T: Sync, Dst: Sync, Src: Sync,

§

impl<T, Src, Dst> Unpin for RigidTransform3D<T, Src, Dst>
where T: Unpin, Dst: Unpin, Src: Unpin,

§

impl<T, Src, Dst> UnwindSafe for RigidTransform3D<T, Src, Dst>
where T: UnwindSafe, Dst: UnwindSafe, Src: UnwindSafe,

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where T: Clone,

source§

unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> ToOwned for T
where T: Clone,

source§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

source§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,