Struct RigidTransform3D
#[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§
§impl<T, Src, Dst> RigidTransform3D<T, Src, Dst>
impl<T, Src, Dst> RigidTransform3D<T, Src, Dst>
pub const fn new(
rotation: Rotation3D<T, Src, Dst>,
translation: Vector3D<T, Dst>,
) -> RigidTransform3D<T, Src, Dst>
pub const fn new( rotation: Rotation3D<T, Src, Dst>, translation: Vector3D<T, Dst>, ) -> RigidTransform3D<T, Src, Dst>
Construct a new rigid transformation, where the rotation
applies first
§impl<T, Src, Dst> RigidTransform3D<T, Src, Dst>where
T: Copy,
impl<T, Src, Dst> RigidTransform3D<T, Src, Dst>where
T: Copy,
pub fn cast_unit<Src2, Dst2>(&self) -> RigidTransform3D<T, Src2, Dst2>
§impl<T, Src, Dst> RigidTransform3D<T, Src, Dst>
impl<T, Src, Dst> RigidTransform3D<T, Src, Dst>
pub fn identity() -> RigidTransform3D<T, Src, Dst>
pub fn identity() -> RigidTransform3D<T, Src, Dst>
Construct an identity transform
pub fn new_from_reversed(
translation: Vector3D<T, Src>,
rotation: Rotation3D<T, Src, Dst>,
) -> RigidTransform3D<T, Src, Dst>
pub fn new_from_reversed( translation: Vector3D<T, Src>, rotation: Rotation3D<T, Src, Dst>, ) -> RigidTransform3D<T, Src, Dst>
Construct a new rigid transformation, where the translation
applies first
pub fn from_rotation( rotation: Rotation3D<T, Src, Dst>, ) -> RigidTransform3D<T, Src, Dst>
pub fn from_translation( translation: Vector3D<T, Dst>, ) -> RigidTransform3D<T, Src, Dst>
pub 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
pub 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
pub 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,
pub 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.
pub fn from_untyped(
transform: &RigidTransform3D<T, UnknownUnit, UnknownUnit>,
) -> RigidTransform3D<T, Src, Dst>
pub fn from_untyped( transform: &RigidTransform3D<T, UnknownUnit, UnknownUnit>, ) -> RigidTransform3D<T, Src, Dst>
Tag a unitless value with units.
Trait Implementations§
§impl<T, Src, Dst> Clone for RigidTransform3D<T, Src, Dst>where
T: Clone,
impl<T, Src, Dst> Clone for RigidTransform3D<T, Src, Dst>where
T: Clone,
§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 more§impl<T, Src, Dst> Debug for RigidTransform3D<T, Src, Dst>where
T: Debug,
impl<T, Src, Dst> Debug for RigidTransform3D<T, Src, Dst>where
T: Debug,
§impl<'de, T, Src, Dst> Deserialize<'de> for RigidTransform3D<T, Src, Dst>
impl<'de, T, Src, Dst> Deserialize<'de> for RigidTransform3D<T, Src, Dst>
§fn deserialize<__D>(
__deserializer: __D,
) -> Result<RigidTransform3D<T, Src, Dst>, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<RigidTransform3D<T, Src, Dst>, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
§impl<T, Src, Dst> From<Rotation3D<T, Src, Dst>> for RigidTransform3D<T, Src, Dst>
impl<T, Src, Dst> From<Rotation3D<T, Src, Dst>> for RigidTransform3D<T, Src, Dst>
§fn from(rot: Rotation3D<T, Src, Dst>) -> RigidTransform3D<T, Src, Dst>
fn from(rot: Rotation3D<T, Src, Dst>) -> RigidTransform3D<T, Src, Dst>
§impl<T, Src, Dst> From<Vector3D<T, Dst>> for RigidTransform3D<T, Src, Dst>
impl<T, Src, Dst> From<Vector3D<T, Dst>> for RigidTransform3D<T, Src, Dst>
§fn from(t: Vector3D<T, Dst>) -> RigidTransform3D<T, Src, Dst>
fn from(t: Vector3D<T, Dst>) -> RigidTransform3D<T, Src, Dst>
§impl<T, Src, Dst> Hash for RigidTransform3D<T, Src, Dst>where
T: Hash,
impl<T, Src, Dst> Hash for RigidTransform3D<T, Src, Dst>where
T: Hash,
§impl<T, Src, Dst> PartialEq for RigidTransform3D<T, Src, Dst>where
T: PartialEq,
impl<T, Src, Dst> PartialEq for RigidTransform3D<T, Src, Dst>where
T: PartialEq,
§impl<T, Src, Dst> Serialize for RigidTransform3D<T, Src, Dst>
impl<T, Src, Dst> Serialize for RigidTransform3D<T, Src, Dst>
§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
§impl<T, Src, Dst> Zeroable for RigidTransform3D<T, Src, Dst>where
T: Zeroable,
impl<T, Src, Dst> Zeroable for RigidTransform3D<T, Src, Dst>where
T: Zeroable,
impl<T, Src, Dst> Copy for RigidTransform3D<T, Src, Dst>where
T: Copy,
impl<T, Src, Dst> Eq for RigidTransform3D<T, Src, Dst>where
T: Eq,
impl<T, Src, Dst> Pod for RigidTransform3D<T, Src, Dst>where
T: Pod,
Src: 'static,
Dst: 'static,
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> AnyVarValue for Twhere
T: VarValue,
impl<T> AnyVarValue for Twhere
T: VarValue,
source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
dyn Any
methods.source§fn clone_boxed(&self) -> Box<dyn AnyVarValue>
fn clone_boxed(&self) -> Box<dyn AnyVarValue>
source§fn clone_boxed_var(&self) -> Box<dyn AnyVar>
fn clone_boxed_var(&self) -> Box<dyn AnyVar>
LocalVar<Self>
.source§fn eq_any(&self, other: &(dyn AnyVarValue + 'static)) -> bool
fn eq_any(&self, other: &(dyn AnyVarValue + 'static)) -> bool
self
equals other
.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
§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
.§fn is_valid_bit_pattern(_bits: &T) -> bool
fn is_valid_bit_pattern(_bits: &T) -> bool
bits
as &Self
.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
)§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more