pub struct Transform3D {
pub matrix: Matrix<f32, Const<4>, Const<4>, ArrayStorage<f32, 4, 4>>,
}
Expand description
A 3D transformation that can be applied to points and point clouds
Fields§
§matrix: Matrix<f32, Const<4>, Const<4>, ArrayStorage<f32, 4, 4>>
Implementations§
Source§impl Transform3D
impl Transform3D
Sourcepub fn identity() -> Transform3D
pub fn identity() -> Transform3D
Create an identity transformation
Sourcepub fn translation(
translation: Matrix<f32, Const<3>, Const<1>, ArrayStorage<f32, 3, 1>>,
) -> Transform3D
pub fn translation( translation: Matrix<f32, Const<3>, Const<1>, ArrayStorage<f32, 3, 1>>, ) -> Transform3D
Create a translation transformation
Sourcepub fn rotation(rotation: Unit<Quaternion<f32>>) -> Transform3D
pub fn rotation(rotation: Unit<Quaternion<f32>>) -> Transform3D
Create a rotation transformation from a quaternion
Sourcepub fn scaling(
scale: Matrix<f32, Const<3>, Const<1>, ArrayStorage<f32, 3, 1>>,
) -> Transform3D
pub fn scaling( scale: Matrix<f32, Const<3>, Const<1>, ArrayStorage<f32, 3, 1>>, ) -> Transform3D
Create a scaling transformation
Sourcepub fn uniform_scaling(scale: f32) -> Transform3D
pub fn uniform_scaling(scale: f32) -> Transform3D
Create a uniform scaling transformation
Sourcepub fn from_translation_rotation(
translation: Matrix<f32, Const<3>, Const<1>, ArrayStorage<f32, 3, 1>>,
rotation: Unit<Quaternion<f32>>,
) -> Transform3D
pub fn from_translation_rotation( translation: Matrix<f32, Const<3>, Const<1>, ArrayStorage<f32, 3, 1>>, rotation: Unit<Quaternion<f32>>, ) -> Transform3D
Create a transformation from translation and rotation
Sourcepub fn transform_point(
&self,
point: &OPoint<f32, Const<3>>,
) -> OPoint<f32, Const<3>>
pub fn transform_point( &self, point: &OPoint<f32, Const<3>>, ) -> OPoint<f32, Const<3>>
Apply the transformation to a point
Sourcepub fn transform_vector(
&self,
vector: &Matrix<f32, Const<3>, Const<1>, ArrayStorage<f32, 3, 1>>,
) -> Matrix<f32, Const<3>, Const<1>, ArrayStorage<f32, 3, 1>>
pub fn transform_vector( &self, vector: &Matrix<f32, Const<3>, Const<1>, ArrayStorage<f32, 3, 1>>, ) -> Matrix<f32, Const<3>, Const<1>, ArrayStorage<f32, 3, 1>>
Apply the transformation to a vector
Sourcepub fn compose(self, other: Transform3D) -> Transform3D
pub fn compose(self, other: Transform3D) -> Transform3D
Compose this transformation with another
Sourcepub fn inverse(self) -> Option<Transform3D>
pub fn inverse(self) -> Option<Transform3D>
Get the inverse transformation
Sourcepub fn is_identity(&self, epsilon: f32) -> bool
pub fn is_identity(&self, epsilon: f32) -> bool
Check if this is approximately the identity transformation
Trait Implementations§
Source§impl Clone for Transform3D
impl Clone for Transform3D
Source§fn clone(&self) -> Transform3D
fn clone(&self) -> Transform3D
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for Transform3D
impl Debug for Transform3D
Source§impl Default for Transform3D
impl Default for Transform3D
Source§fn default() -> Transform3D
fn default() -> Transform3D
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for Transform3D
impl<'de> Deserialize<'de> for Transform3D
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<Transform3D, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<Transform3D, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl From<Isometry<f32, Unit<Quaternion<f32>>, 3>> for Transform3D
impl From<Isometry<f32, Unit<Quaternion<f32>>, 3>> for Transform3D
Source§fn from(isometry: Isometry<f32, Unit<Quaternion<f32>>, 3>) -> Transform3D
fn from(isometry: Isometry<f32, Unit<Quaternion<f32>>, 3>) -> Transform3D
Converts to this type from the input type.
Source§impl From<Matrix<f32, Const<4>, Const<4>, ArrayStorage<f32, 4, 4>>> for Transform3D
impl From<Matrix<f32, Const<4>, Const<4>, ArrayStorage<f32, 4, 4>>> for Transform3D
Source§fn from(
matrix: Matrix<f32, Const<4>, Const<4>, ArrayStorage<f32, 4, 4>>,
) -> Transform3D
fn from( matrix: Matrix<f32, Const<4>, Const<4>, ArrayStorage<f32, 4, 4>>, ) -> Transform3D
Converts to this type from the input type.
Source§impl Mul for Transform3D
impl Mul for Transform3D
Source§type Output = Transform3D
type Output = Transform3D
The resulting type after applying the
*
operator.Source§fn mul(self, rhs: Transform3D) -> <Transform3D as Mul>::Output
fn mul(self, rhs: Transform3D) -> <Transform3D as Mul>::Output
Performs the
*
operation. Read moreSource§impl PartialEq for Transform3D
impl PartialEq for Transform3D
Source§impl Serialize for Transform3D
impl Serialize for Transform3D
Source§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,
Serialize this value into the given Serde serializer. Read more
impl Copy for Transform3D
impl StructuralPartialEq for Transform3D
Auto Trait Implementations§
impl Freeze for Transform3D
impl RefUnwindSafe for Transform3D
impl Send for Transform3D
impl Sync for Transform3D
impl Unpin for Transform3D
impl UnwindSafe for Transform3D
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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>
Converts
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>
Converts
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 moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self
from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self
is actually part of its subset T
(and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset
but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self
to the equivalent element of its superset.