From 1fda2daaec6d19abe180f3c7719fdb9aef55d1b4 Mon Sep 17 00:00:00 2001 From: DashyFox Date: Mon, 14 Apr 2025 16:59:32 +0300 Subject: [PATCH] Update Tween.h --- Tween.h | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) 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) {