pub struct Transform3<T: Float> {
pub m: [[T; 3]; 3],
pub t: Vec3<T>,
}Expand description
3×3 matrix + translation = affine transform in ℝ³.
Fields§
§m: [[T; 3]; 3]3x3 matrix for the linear part of the transform
t: Vec3<T>Translation vector
Implementations§
Source§impl<T: Float> Transform3<T>
impl<T: Float> Transform3<T>
Sourcepub fn transform_point(&self, p: Point3<T>) -> Point3<T>
pub fn transform_point(&self, p: Point3<T>) -> Point3<T>
Apply to a point: x ↦ M·x + t
Sourcepub fn transform_vec(&self, v: Vec3<T>) -> Vec3<T>
pub fn transform_vec(&self, v: Vec3<T>) -> Vec3<T>
Apply to a vector (no translation)
Sourcepub fn inverse(&self) -> Option<Transform3<T>>
pub fn inverse(&self) -> Option<Transform3<T>>
Invert (requires det(M) ≠ 0)
Trait Implementations§
Source§impl<T: Clone + Float> Clone for Transform3<T>
impl<T: Clone + Float> Clone for Transform3<T>
Source§fn clone(&self) -> Transform3<T>
fn clone(&self) -> Transform3<T>
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<T: Copy + Float> Copy for Transform3<T>
impl<T: Float> StructuralPartialEq for Transform3<T>
Auto Trait Implementations§
impl<T> Freeze for Transform3<T>where
T: Freeze,
impl<T> RefUnwindSafe for Transform3<T>where
T: RefUnwindSafe,
impl<T> Send for Transform3<T>where
T: Send,
impl<T> Sync for Transform3<T>where
T: Sync,
impl<T> Unpin for Transform3<T>where
T: Unpin,
impl<T> UnwindSafe for Transform3<T>where
T: 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