[−][src]Function minterpolate::get_interpolation_factor
pub fn get_interpolation_factor(
input: f32,
inputs: &[f32]
) -> Option<(usize, f32)>
Calculate the keyframe index in the input collection, and the interpolation factor between the current keyframe and the next keyframe.
Parameters
input
: the input value to the functioninputs
: list of discrete input values for each keyframe
Returns
The index into the inputs
, corresponding to the given input
, and also the interpolation
factor, i.e. the distance traveled between the current keyframe and the next keyframe.