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);
void lerp_value_from_prev(NumericType ¤t_value, double d, double prev_d, const NumericType &prev_value, const NumericType &ending_value)
Applies the linear lerp computation for a single parameter, when the starting value is implicit.
void lerp_value(NumericType ¤t_value, double d, const NumericType &starting_value, const NumericType &ending_value)
Applies the linear lerp computation for a single parameter.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.