diff --git a/Tween.h b/Tween.h index 20512c4..341ebb5 100644 --- a/Tween.h +++ b/Tween.h @@ -92,6 +92,22 @@ public: frameTime = 1000 / fps; } + float getFrom() const { + return from; + } + + float getTo() const { + return to; + } + + static float integrateEasing(EasingFunc::eFunc easing, int steps = 100) { + float sum = 0; + for (int i = 0; i <= steps; ++i) { + float t = i / (float)steps; + sum += easing(t); + } + return sum / (steps + 1); // Среднее значение функции + } private: static float lerp(float a, float b, float t) {