Skip to main content

sample_clip

Function sample_clip 

Source
pub fn sample_clip(skeleton: &Skeleton, clip: &Clip, frames: usize) -> PoseGrid
Expand description

Sample clip on a uniform frames-sample grid and FK to model space.

Sampling is intentionally tolerant and storage-driven rather than a shape validation step. Tracks with an empty timeline or a target bone outside skeleton are skipped. TrackValues::Vec3s writes translation or scale according to Track::property, ignores the rotation property, and uses Vec3::ZERO for missing values (so a missing scale value is zero, not the transform scale default of one). TrackValues::Quats writes rotation regardless of Track::property and uses Quat::IDENTITY for missing values. This tolerant behaviour is distinct from strict operations, which should call crate::validate_document_shape at their own boundary.

§Panics

Panics if a skeleton bone’s parent index is outside Skeleton::bones. Loader crates also order parents before children; hand-built documents must preserve both invariants for correct FK.