14 #ifndef LERP_HELPERS_H
15 #define LERP_HELPERS_H
25 template<
class NumericType>
29 const NumericType &starting_value,
30 const NumericType &ending_value) {
31 current_value = starting_value + d * (ending_value - starting_value);
41 template<
class NumericType>
44 double d,
double prev_d,
45 const NumericType &prev_value,
46 const NumericType &ending_value) {
48 current_value = ending_value;
50 NumericType starting_value =
51 (prev_value - prev_d * ending_value) / (1.0 - prev_d);
52 current_value = starting_value + d * (ending_value - starting_value);