pub struct Transform3D<T: Copy + Debug + 'static> { /* private fields */ }Expand description
Transform3D represents a 3D transformation (rotation + translation) When the glam feature is enabled, it uses glam’s optimized types internally
Implementations§
Source§impl Transform3D<f32>
impl Transform3D<f32>
Sourcepub const fn from_translation_euler_xyz(
translation: [Length32; 3],
rotation: [Angle32; 3],
) -> Self
pub const fn from_translation_euler_xyz( translation: [Length32; 3], rotation: [Angle32; 3], ) -> Self
Creates a transform from unit-typed translation and XYZ Euler angles.
rotation is [roll_x, pitch_y, yaw_z]. Rotations are applied X, then Y, then Z,
producing Rz * Ry * Rx for column vectors. Translation is applied last.
Const unit values use their SI base representation: meters and radians.
Source§impl Transform3D<f64>
impl Transform3D<f64>
Sourcepub const fn from_translation_euler_xyz(
translation: [Length64; 3],
rotation: [Angle64; 3],
) -> Self
pub const fn from_translation_euler_xyz( translation: [Length64; 3], rotation: [Angle64; 3], ) -> Self
Creates a transform from unit-typed translation and XYZ Euler angles.
rotation is [roll_x, pitch_y, yaw_z]. Rotations are applied X, then Y, then Z,
producing Rz * Ry * Rx for column vectors. Translation is applied last.
Const unit values use their SI base representation: meters and radians.
Source§impl<T: Copy + Debug + Default + 'static> Transform3D<T>
impl<T: Copy + Debug + Default + 'static> Transform3D<T>
Sourcepub fn from_matrix(mat: [[T; 4]; 4]) -> Self
pub fn from_matrix(mat: [[T; 4]; 4]) -> Self
Creates a homogeneous 4x4 transform indexed as mat[row][column].
Each inner array is a row; points are column vectors (p_out = mat * p_in).
Translation is [mat[0][3], mat[1][3], mat[2][3]]; the last row must be [0, 0, 0, 1].
The convention is backend-independent: callers must not transpose for glam.
Glam/Rerun adapters repack into columns internally; the fallback stores rows directly.
Nalgebra/faer adapters copy by (row, column), independent of storage order.
Sourcepub fn to_matrix(self) -> [[T; 4]; 4]
pub fn to_matrix(self) -> [[T; 4]; 4]
Returns a homogeneous 4x4 matrix indexed as mat[row][column].
Each inner array is a row, with translation in the last column, regardless of backend.
Uses the same column-vector convention as Self::from_matrix.
Source§impl Transform3D<f32>
impl Transform3D<f32>
Source§impl Transform3D<f64>
impl Transform3D<f64>
Source§impl Transform3D<f32>
impl Transform3D<f32>
Sourcepub fn position(&self) -> Point3<Length32>
pub fn position(&self) -> Point3<Length32>
The translation as a point: where the pose sits in its parent frame.
Sourcepub fn transform_point(&self, p: Point3<Length32>) -> Point3<Length32>
pub fn transform_point(&self, p: Point3<Length32>) -> Point3<Length32>
p mapped through the transform: rotation, then translation.
Sourcepub fn transform_vector(&self, v: Point3<Length32>) -> Point3<Length32>
pub fn transform_vector(&self, v: Point3<Length32>) -> Point3<Length32>
v mapped through the rotation only, for directions and
offsets.
Sourcepub fn transform_points<const N: usize>(
&self,
points: &mut Point3Soa<Length32, N>,
)
pub fn transform_points<const N: usize>( &self, points: &mut Point3Soa<Length32, N>, )
Every point in the set mapped through the transform, in place.
May differ from Self::transform_point by a rounding step.
Source§impl Transform3D<f64>
impl Transform3D<f64>
Sourcepub fn position(&self) -> Point3<Length64>
pub fn position(&self) -> Point3<Length64>
The translation as a point: where the pose sits in its parent frame.
Sourcepub fn transform_point(&self, p: Point3<Length64>) -> Point3<Length64>
pub fn transform_point(&self, p: Point3<Length64>) -> Point3<Length64>
p mapped through the transform: rotation, then translation.
Sourcepub fn transform_vector(&self, v: Point3<Length64>) -> Point3<Length64>
pub fn transform_vector(&self, v: Point3<Length64>) -> Point3<Length64>
v mapped through the rotation only, for directions and
offsets.
Sourcepub fn transform_points<const N: usize>(
&self,
points: &mut Point3Soa<Length64, N>,
)
pub fn transform_points<const N: usize>( &self, points: &mut Point3Soa<Length64, N>, )
Every point in the set mapped through the transform, in place.
May differ from Self::transform_point by a rounding step.
Source§impl Transform3D<f32>
impl Transform3D<f32>
Trait Implementations§
impl<T: Copy + Copy + Debug + 'static> Copy for Transform3D<T>
Source§impl<T> Decode<()> for Transform3D<T>
impl<T> Decode<()> for Transform3D<T>
Source§impl<'de, T> Deserialize<'de> for Transform3D<T>
impl<'de, T> Deserialize<'de> for Transform3D<T>
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>,
Source§impl<T> Encode for Transform3D<T>
impl<T> Encode for Transform3D<T>
Source§impl From<Transform3D<f32>> for Affine3A
impl From<Transform3D<f32>> for Affine3A
Source§fn from(p: Transform3D<f32>) -> Self
fn from(p: Transform3D<f32>) -> Self
Source§impl From<Transform3D<f64>> for DAffine3
impl From<Transform3D<f64>> for DAffine3
Source§fn from(p: Transform3D<f64>) -> Self
fn from(p: Transform3D<f64>) -> Self
Source§impl Mul for Transform3D<f32>
impl Mul for Transform3D<f32>
Source§impl Mul for Transform3D<f64>
impl Mul for Transform3D<f64>
Source§impl Mul for &Transform3D<f32>
Reference implementations for f32
impl Mul for &Transform3D<f32>
Reference implementations for f32
Source§impl Mul for &Transform3D<f64>
Reference implementations for f64
impl Mul for &Transform3D<f64>
Reference implementations for f64