Struct Transform3D
#[repr(C)]pub struct Transform3D {
pub translation: [f32; 3],
pub rotation: [f32; 4],
pub scale: [f32; 3],
}Expand description
3D affine transform representation (rotation stored as [x, y, z, w]).
Fields§
§translation: [f32; 3]Translation [x, y, z] in meters.
rotation: [f32; 4]Unit quaternion rotation [x, y, z, w].
scale: [f32; 3]Scale factor [sx, sy, sz].
Implementations§
§impl Transform3D
impl Transform3D
pub fn lerp(&self, other: &Transform3D, t: f32) -> Transform3D
pub fn lerp(&self, other: &Transform3D, t: f32) -> Transform3D
Spherical linear interpolation between two transforms.
pub fn to_motor_f64(&self) -> Motor
pub fn to_motor_f64(&self) -> Motor
Converts the rigid rotation ([x, y, z, w]) and translation ([x, y, z]) of this
Transform3D into an f64 PGA dual-quaternion Motor ([w, x, y, z] rotor order).
pub fn from_motor_f64(m: &Motor) -> Transform3D
pub fn from_motor_f64(m: &Motor) -> Transform3D
Reconstructs a unit-scale Transform3D from an f64 PGA dual-quaternion Motor.
pub fn to_pga_motor_f32(&self) -> Motor
pub fn to_pga_motor_f32(&self) -> Motor
Converts this Transform3D directly into an f32 crate::spatial_math::pga::Motor.
pub fn from_pga_motor_f32(m: Motor) -> Transform3D
pub fn from_pga_motor_f32(m: Motor) -> Transform3D
Reconstructs a unit-scale Transform3D from an f32 crate::spatial_math::pga::Motor.
Trait Implementations§
§impl Clone for Transform3D
impl Clone for Transform3D
§fn clone(&self) -> Transform3D
fn clone(&self) -> Transform3D
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for Transform3D
§impl Debug for Transform3D
impl Debug for Transform3D
§impl Default for Transform3D
impl Default for Transform3D
§fn default() -> Transform3D
fn default() -> Transform3D
Returns the “default value” for a type. Read more
§impl PartialEq for Transform3D
impl PartialEq 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