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

Function sample_vec3

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

Source from the content-addressed store, hash-verified

689}
690
691fn sample_vec3(timestamps: &[f32], values: &[[f32; 3]], time: f32) -> [f32; 3] {
692 if values.is_empty() { return [0.0; 3]; }
693 if values.len() == 1 { return values[0]; }
694 let (i0, i1, t) = find_keyframe_pair(timestamps, time);
695 if i0 >= values.len() { return values[values.len() - 1]; }
696 if i1 >= values.len() { return values[values.len() - 1]; }
697 lerp_vec3(&values[i0], &values[i1], t)
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]; }

Callers 1

Calls 2

find_keyframe_pairFunction · 0.85
lerp_vec3Function · 0.85

Tested by

no test coverage detected