23 lines
631 B
C++
23 lines
631 B
C++
#pragma once
|
|
|
|
// Funcions de suavitzat per animacions. Totes accepten t en el rang [0, 1]
|
|
// i retornen un valor en [0, 1] (amb overshoot possible en algunes variants).
|
|
namespace Easing {
|
|
|
|
auto linear(float t) -> float;
|
|
|
|
// Quadratic
|
|
auto outQuad(float t) -> float;
|
|
auto inQuad(float t) -> float;
|
|
auto inOutQuad(float t) -> float;
|
|
|
|
// Cubic
|
|
auto outCubic(float t) -> float;
|
|
auto inCubic(float t) -> float;
|
|
|
|
// Interpolacions (aplicar després d'un easing al paràmetre t)
|
|
auto lerp(float a, float b, float t) -> float;
|
|
auto lerpInt(int a, int b, float t) -> int;
|
|
|
|
} // namespace Easing
|