bevy_math::curve::cores

Function uneven_interp

Source
pub fn uneven_interp(times: &[f32], t: f32) -> InterpolationDatum<usize>
Available on crate feature curve only.
Expand description

Given a list of times and a target value, get the interpolation relationship for the target value in terms of the indices of the starting list. In a sense, this encapsulates the heart of uneven/keyframe sampling.

times is assumed to be sorted, deduplicated, and consisting only of finite values. It is also assumed to contain at least two values.

ยงPanics

This function will panic if times contains NAN.