10 static T linear_interpolate(T start,
12 const std::function<
float(
float)>& function,
14 float l_adjusted_time = 0.0f;
19 const float f = function(t);
22 if (l_adjusted_time < 0) {
23 l_adjusted_time = 0.0f;
25 if (l_adjusted_time > 1.0f) {
26 l_adjusted_time = 1.0f;
29 float time_dif = 1.0f - l_adjusted_time;
31 return start * time_dif + end * l_adjusted_time;