15 #include "cLerpInterval.h" 16 #include "string_utils.h" 29 if (blend_type ==
"easeIn") {
31 }
else if (blend_type ==
"easeOut") {
33 }
else if (blend_type ==
"easeInOut") {
34 return BT_ease_in_out;
35 }
else if (blend_type ==
"noBlend") {
50 double CLerpInterval::
51 compute_delta(
double t)
const {
53 if (duration == 0.0) {
59 t = min(max(t, 0.0), 1.0);
61 switch (_blend_type) {
65 return ((3.0 * t2) - (t2 * t)) * 0.5;
71 return ((3.0 * t) - (t2 * t)) * 0.5;
77 return (3.0 * t2) - (2.0 * t * t2);
static BlendType string_blend_type(const string &blend_type)
Returns the BlendType enumerated value corresponding to the indicated string, or BT_invalid if the st...
double get_duration() const
Returns the duration of the interval in seconds.
TypeHandle is the identifier used to differentiate C++ class types.