Skip to main content

SpatialTransform

Type Alias SpatialTransform 

Source
pub type SpatialTransform = SpatialTransform<f64>;
Expand description

Plucker transform: rigid body transformation acting on spatial vectors.

Represents a coordinate transform from frame A to frame B. Stored as rotation R and translation p (position of B’s origin in A’s frame).

Do not write xf.rot * v or xf.rot.transpose() * v by hand. For a body transform from forward kinematics, rot is the world→body rotation and pos is the body origin in world coordinates — a convention every raw call site must independently remember, and getting it backwards is invisible at identity. Use the named, direction-carrying methods on SpatialTransformExt instead: SpatialTransformExt::body_to_world_point, SpatialTransformExt::world_to_body_point, SpatialTransformExt::body_to_world_dir, and SpatialTransformExt::world_to_body_dir.

Aliased Type§

#[repr(C)]
pub struct SpatialTransform { pub rot: Mat3<f64>, pub pos: Vec3<f64>, }

Fields§

§rot: Mat3<f64>§pos: Vec3<f64>

Trait Implementations§

Source§

impl SpatialTransformExt for SpatialTransform

Source§

fn body_to_world_point(&self, p: Vec3) -> Vec3

Map a point in body coordinates to world coordinates: pos + rot.transpose() * p.
Source§

fn world_to_body_point(&self, p: Vec3) -> Vec3

Map a point in world coordinates to body coordinates: rot * (p - pos).
Source§

fn body_to_world_dir(&self, d: Vec3) -> Vec3

Rotate a direction (axis, force, velocity, offset) from body to world: rot.transpose() * d. No translation.
Source§

fn world_to_body_dir(&self, d: Vec3) -> Vec3

Rotate a direction (axis, force, velocity, offset) from world to body: rot * d. No translation.