pub struct Transform3D<S: RealField + Copy> {
pub tx: S,
pub ty: S,
pub tz: S,
pub rx: S,
pub ry: S,
pub rz: S,
}Expand description
A 3D rigid transformation (rotation + translation).
Fields§
§tx: STranslation in x direction.
ty: STranslation in y direction.
tz: STranslation in z direction.
rx: SRotation around x axis (roll) in radians.
ry: SRotation around y axis (pitch) in radians.
rz: SRotation around z axis (yaw) in radians.
Implementations§
Source§impl<S: RealField + Copy> Transform3D<S>
impl<S: RealField + Copy> Transform3D<S>
Sourcepub fn translation(tx: S, ty: S, tz: S) -> Self
pub fn translation(tx: S, ty: S, tz: S) -> Self
Creates a new transform with translation only.
Sourcepub fn rotation(rx: S, ry: S, rz: S) -> Self
pub fn rotation(rx: S, ry: S, rz: S) -> Self
Creates a new transform with rotation only (Euler angles XYZ).
Sourcepub fn new(tx: S, ty: S, tz: S, rx: S, ry: S, rz: S) -> Self
pub fn new(tx: S, ty: S, tz: S, rx: S, ry: S, rz: S) -> Self
Creates a new transform with both translation and rotation.
Sourcepub fn to_isometry(&self) -> Isometry3<S>
pub fn to_isometry(&self) -> Isometry3<S>
Converts to a nalgebra Isometry3.
Sourcepub fn from_isometry(iso: &Isometry3<S>) -> Self
pub fn from_isometry(iso: &Isometry3<S>) -> Self
Creates from a nalgebra Isometry3.
Sourcepub fn transform_point(&self, x: S, y: S, z: S) -> (S, S, S)
pub fn transform_point(&self, x: S, y: S, z: S) -> (S, S, S)
Transforms a 3D point.
Sourcepub fn transform_points(&self, points: &[(S, S, S)]) -> Vec<(S, S, S)>
pub fn transform_points(&self, points: &[(S, S, S)]) -> Vec<(S, S, S)>
Transforms a vector of 3D points.
Sourcepub fn is_identity(&self, epsilon: S) -> bool
pub fn is_identity(&self, epsilon: S) -> bool
Checks if this is approximately an identity transform.
Trait Implementations§
Source§impl<S: Clone + RealField + Copy> Clone for Transform3D<S>
impl<S: Clone + RealField + Copy> Clone for Transform3D<S>
Source§fn clone(&self) -> Transform3D<S>
fn clone(&self) -> Transform3D<S>
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 moreimpl<S: Copy + RealField + Copy> Copy for Transform3D<S>
impl<S: RealField + Copy> StructuralPartialEq for Transform3D<S>
Auto Trait Implementations§
impl<S> Freeze for Transform3D<S>where
S: Freeze,
impl<S> RefUnwindSafe for Transform3D<S>where
S: RefUnwindSafe,
impl<S> Send for Transform3D<S>
impl<S> Sync for Transform3D<S>
impl<S> Unpin for Transform3D<S>where
S: Unpin,
impl<S> UnwindSafe for Transform3D<S>where
S: UnwindSafe,
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.