diff --git a/projects/mtg/include/Easing.h b/projects/mtg/include/Easing.h index 93b4fc702..e12b751a4 100644 --- a/projects/mtg/include/Easing.h +++ b/projects/mtg/include/Easing.h @@ -25,7 +25,7 @@ public: void finish() { value = start_value + delta_value; - time_acc = 0; duration = 0; + time_acc = duration; } void update(float dt) @@ -75,15 +75,15 @@ public: void updateValue() { - float time_tmp = time_acc * 2 / duration; + float time_tmp = (time_acc * 2) / duration; if (time_tmp < 1) { - value = delta_value/2*time_tmp*time_tmp + start_value; + value = delta_value * 0.5 * time_tmp * time_tmp + start_value; } else { time_tmp -= 1; - value = -delta_value/2 * (time_tmp*(time_tmp-2) - 1) + start_value; + value = - delta_value * 0.5 * (time_tmp * (time_tmp - 2) - 1) + start_value; } } };