pub struct JointPoseData {
pub name: String,
pub rotation: [f64; 4],
pub translation: [f64; 3],
pub parent: Option<String>,
pub segment: Option<String>,
}Expand description
Full state of a single joint in a pose snapshot.
Fields§
§name: StringUnique joint name (e.g. "LeftUpLeg", "Spine1").
rotation: [f64; 4]Joint rotation as a unit quaternion [x, y, z, w].
translation: [f64; 3]Joint translation in local space (bone-relative).
parent: Option<String>Optional parent joint name. None for the root.
segment: Option<String>Canonical “segment” this joint belongs to for ScaleMode::SegmentWise.
E.g. "UpperLeg", "Spine", "Forearm", etc.
Implementations§
Source§impl JointPoseData
impl JointPoseData
Sourcepub fn new(name: impl Into<String>) -> Self
pub fn new(name: impl Into<String>) -> Self
Construct a joint with an identity rotation and zero translation.
Sourcepub fn with_rotation(self, rot: [f64; 4]) -> Self
pub fn with_rotation(self, rot: [f64; 4]) -> Self
Builder: set rotation.
Sourcepub fn with_translation(self, t: [f64; 3]) -> Self
pub fn with_translation(self, t: [f64; 3]) -> Self
Builder: set translation.
Sourcepub fn with_parent(self, parent: impl Into<String>) -> Self
pub fn with_parent(self, parent: impl Into<String>) -> Self
Builder: set parent joint name.
Sourcepub fn with_segment(self, seg: impl Into<String>) -> Self
pub fn with_segment(self, seg: impl Into<String>) -> Self
Builder: set segment label.
Sourcepub fn translation_length(&self) -> f64
pub fn translation_length(&self) -> f64
Euclidean length of the translation vector.
Trait Implementations§
Source§impl Clone for JointPoseData
impl Clone for JointPoseData
Source§fn clone(&self) -> JointPoseData
fn clone(&self) -> JointPoseData
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for JointPoseData
impl Debug for JointPoseData
Source§impl PartialEq for JointPoseData
impl PartialEq for JointPoseData
impl StructuralPartialEq for JointPoseData
Auto Trait Implementations§
impl Freeze for JointPoseData
impl RefUnwindSafe for JointPoseData
impl Send for JointPoseData
impl Sync for JointPoseData
impl Unpin for JointPoseData
impl UnsafeUnpin for JointPoseData
impl UnwindSafe for JointPoseData
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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>
Converts
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>
Converts
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