pub struct Pose {
pub rotation: UnitQuat,
pub translation: Vec3,
}Expand description
A 6DOF pose represented by rotation and translation.
This represents a rigid body transformation in 3D space with a quaternion for rotation and a 3D vector for translation. The pose transforms points from local/object coordinates to world/reference coordinates.
Fields§
§rotation: UnitQuatRotation component as a unit quaternion
translation: Vec3Translation component as a 3D vector
Implementations§
Source§impl Pose
impl Pose
Sourcepub fn transform_point(&self, local: Vec3) -> Vec3
pub fn transform_point(&self, local: Vec3) -> Vec3
Transform a point from local/object coordinates to world/reference coordinates.
Applies both rotation and translation to transform a point position.
The formula is: world_point = rotation * local_point + translation
§Arguments
local- Point in local coordinates
§Returns
Point in world/reference coordinates
Sourcepub fn transform_vec(&self, local: Vec3) -> Vec3
pub fn transform_vec(&self, local: Vec3) -> Vec3
Transform a vector from local/object coordinates to world/reference coordinates.
Applies only the rotation component, ignoring translation. This is appropriate for transforming directions, velocities, forces, or any vector quantity that represents a direction rather than a position.
§Arguments
local- Vector in local coordinates
§Returns
Vector in world/reference coordinates
Sourcepub fn inverse(&self) -> Pose
pub fn inverse(&self) -> Pose
Compute the inverse of the pose.
Returns a pose that transforms from world/reference coordinates back to local/object coordinates. The formula is: X⁻¹ = [R⁻¹, -R⁻¹·t]
§Returns
Inverse pose that undoes this transformation
Sourcepub fn is_identity(&self, epsilon: Real) -> bool
pub fn is_identity(&self, epsilon: Real) -> bool
Sourcepub fn into_array(self) -> [Real; 7]
pub fn into_array(self) -> [Real; 7]
Convert the pose to a [Real; 7] array with the format [x, y, z, i, j, k, w].
Sourcepub fn from_array(arr: [Real; 7]) -> Self
pub fn from_array(arr: [Real; 7]) -> Self
Create a pose from a [Real; 7] array with the format [x, y, z, i, j, k, w].
Sourcepub fn from_slice(arr: &[Real]) -> Self
pub fn from_slice(arr: &[Real]) -> Self
Create a pose from a slice with the format [x, y, z, i, j, k, w].
§Panics
Panics if the slice length is not 7.
Trait Implementations§
Source§impl From<Pose> for PluckerTransform
impl From<Pose> for PluckerTransform
impl Copy for Pose
Auto Trait Implementations§
impl Freeze for Pose
impl RefUnwindSafe for Pose
impl Send for Pose
impl Sync for Pose
impl Unpin for Pose
impl UnwindSafe for Pose
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.