pub struct Transform3D {
pub position: Vec3,
pub rotation: Quat,
pub scale: Vec3,
}Expand description
A 3D transform (position, quaternion rotation, non-uniform scale).
Fields§
§position: Vec3§rotation: Quat§scale: Vec3Implementations§
Source§impl Transform3D
impl Transform3D
Sourcepub fn apply_to_point(&self, point: Vec3) -> Vec3
pub fn apply_to_point(&self, point: Vec3) -> Vec3
Apply this transform to a 3D point.
Sourcepub fn inverse_matrix(&self) -> Mat4
pub fn inverse_matrix(&self) -> Mat4
Compute the inverse 4x4 matrix of this transform.
Use this to undo the transform: t.inverse_matrix() * point4 ≈ original.
For non-uniform scale with rotation, the SRT decomposition doesn’t
round-trip cleanly, so we provide the inverse as a matrix directly.
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§impl<'de> Deserialize<'de> for Transform3D
impl<'de> Deserialize<'de> for Transform3D
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
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 PartialEq for Transform3D
impl PartialEq for Transform3D
Source§impl Serialize for Transform3D
impl Serialize for Transform3D
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 UnsafeUnpin 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