pub struct PoseRetargeter;Expand description
Stateless retargeter — all methods are free functions exposed as associated functions for a clean call site.
Implementations§
Source§impl PoseRetargeter
impl PoseRetargeter
Sourcepub fn retarget_pose(
pose: &PoseSnapshot,
config: &RetargetConfig,
) -> PoseSnapshot
pub fn retarget_pose( pose: &PoseSnapshot, config: &RetargetConfig, ) -> PoseSnapshot
Retarget pose to a body with dimensions described by config.
Joint rotations are preserved unchanged. Joint translations are
scaled according to config.scale_mode.
Sourcepub fn segment_lengths(pose: &PoseSnapshot) -> HashMap<String, f64>
pub fn segment_lengths(pose: &PoseSnapshot) -> HashMap<String, f64>
Compute per-segment bone lengths from the translations stored in a pose.
For each unique segment label (JointPoseData::segment), the function
sums the Euclidean translation lengths of all joints in that segment.
Joints without a segment label are collected under the key "unnamed".
Sourcepub fn normalize_pose(pose: &PoseSnapshot) -> PoseSnapshot
pub fn normalize_pose(pose: &PoseSnapshot) -> PoseSnapshot
Normalise a pose so the body height equals 1.0 (i.e. all translations are expressed as fractions of the total body height).
If pose.body_height_cm is zero, the maximum translation length across
all joints is used as the normalisation divisor. If that is also zero
the pose is returned unchanged.
Sourcepub fn translation_error(a: &PoseSnapshot, b: &PoseSnapshot) -> f64
pub fn translation_error(a: &PoseSnapshot, b: &PoseSnapshot) -> f64
Return the Euclidean distance between corresponding joint translations
in a and b. Only joints present in both snapshots are compared.
Useful for measuring retargeting error.
Auto Trait Implementations§
impl Freeze for PoseRetargeter
impl RefUnwindSafe for PoseRetargeter
impl Send for PoseRetargeter
impl Sync for PoseRetargeter
impl Unpin for PoseRetargeter
impl UnsafeUnpin for PoseRetargeter
impl UnwindSafe for PoseRetargeter
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> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more