mirror of
https://github.com/Show-maket/Tween.git
synced 2025-05-03 14:50:24 +00:00
Update Tween.h
This commit is contained in:
parent
bca2439c15
commit
1fda2daaec
16
Tween.h
16
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) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user