Function blender_armature::get_surrounding_keyframes [−][src]
pub fn get_surrounding_keyframes(
keyframes: &Vec<BoneKeyframe>,
current_frame: f32
) -> (BoneKeyframe, BoneKeyframe)
If you’re sampling frame 1.5 and there are three keyframes - 0, 2, 3 the surrounding keyframes are 0 and 2.
If you’re sampling frame 1.5 and there are three keyframes - 10, 15, 31 the surrounding keyframes are 0 and 0.
If you’re sampling frame 1.5 and there are three keyframes - 0, and 1 then the surrounding keyframes are 1 and 1.
We assume that the keyframes are stored in ascending order.
TODO: Binary search instead of linear