animacions a renderinfo
This commit is contained in:
22
source/utils/easing.hpp
Normal file
22
source/utils/easing.hpp
Normal file
@@ -0,0 +1,22 @@
|
||||
#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
|
||||
Reference in New Issue
Block a user