MCPcopy Create free account
hub / github.com/Bloom-Engine/engine / sample_quat

Function sample_quat

native/shared/src/models.rs:700–707  ·  view source on GitHub ↗
(timestamps: &[f32], values: &[[f32; 4]], time: f32)

Source from the content-addressed store, hash-verified

698}
699
700fn sample_quat(timestamps: &[f32], values: &[[f32; 4]], time: f32) -> [f32; 4] {
701 if values.is_empty() { return [0.0, 0.0, 0.0, 1.0]; }
702 if values.len() == 1 { return values[0]; }
703 let (i0, i1, t) = find_keyframe_pair(timestamps, time);
704 if i0 >= values.len() { return values[values.len() - 1]; }
705 if i1 >= values.len() { return values[values.len() - 1]; }
706 quat_slerp(&values[i0], &values[i1], t)
707}
708
709fn compute_joint_transforms(
710 skeleton: &SkeletonData,

Callers 1

Calls 2

find_keyframe_pairFunction · 0.85
quat_slerpFunction · 0.85

Tested by

no test coverage detected