pub struct Pose {
pub local: Vec<Transform>,
}Expand description
A full local pose of a skeleton: one Transform per joint, index-aligned
with Skeleton::joints.
Fields§
§local: Vec<Transform>Implementations§
Source§impl Pose
impl Pose
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
pub fn joint(&self, i: usize) -> Option<Transform>
Sourcepub fn globals(&self, skel: &Skeleton) -> Vec<Transform>
pub fn globals(&self, skel: &Skeleton) -> Vec<Transform>
Global transform per joint under this pose. Same composition as
Skeleton::global_transform (parent-before-child joint order is a
standing invariant of add_joint), but pose-driven and iterative.
Sourcepub fn apply_clip(&mut self, skel: &Skeleton, anim: &Animation, t: f32)
pub fn apply_clip(&mut self, skel: &Skeleton, anim: &Animation, t: f32)
Write every Target::Joint channel of anim (sampled at t, loop
wrapped) into the pose, honoring each channel’s Space.
Target::Node channels belong to scene evaluation and are skipped.
Sourcepub fn blend_toward(&mut self, other: &Pose, w: f32)
pub fn blend_toward(&mut self, other: &Pose, w: f32)
Blend toward other in place: w = 0 keeps everything, w = 1
takes other wholesale.
Source§impl Pose
impl Pose
Sourcepub fn apply_layer(
&mut self,
skel: &Skeleton,
animations: &BTreeMap<AnimationId, Animation>,
layer: &Layer,
)
pub fn apply_layer( &mut self, skel: &Skeleton, animations: &BTreeMap<AnimationId, Animation>, layer: &Layer, )
Blend every masked joint toward the layer’s clip pose by weight.
A missing clip or zero weight leaves the pose untouched.
Sourcepub fn ik_ccd(
&mut self,
skel: &Skeleton,
chain: &[usize],
target: Vec3,
iters: u32,
tol: f32,
) -> f32
pub fn ik_ccd( &mut self, skel: &Skeleton, chain: &[usize], target: Vec3, iters: u32, tol: f32, ) -> f32
Cyclic coordinate descent toward target, pulling the last joint of
chain (a consecutive parent→child run) along. Returns the final tip
distance. iters bounds the work; tol stops early once close
enough. Invalid chains do nothing and report INFINITY.
Each joint move is one world-space align rotation (arc quat from the
pivot→tip and pivot→target directions, no acos); the push back into
the local slot goes through matrix composition, so joint scales and
parent chains stay exact.