Treballant en la intro
This commit is contained in:
@@ -242,6 +242,48 @@ double easeInOut(double t)
|
||||
return t < 0.5 ? 2 * t * t : -1 + (4 - 2 * t) * t;
|
||||
}
|
||||
|
||||
// Función de suavizado
|
||||
double easeInOutExpo(double t)
|
||||
{
|
||||
return t == 0 ? 0 : (t == 1 ? 1 : (t < 0.5 ? pow(2, 20 * t - 10) / 2 : (2 - pow(2, -20 * t + 10)) / 2));
|
||||
}
|
||||
|
||||
// Función de suavizado
|
||||
double easeOutBounce(double t)
|
||||
{
|
||||
if (t < 1 / 2.75)
|
||||
{
|
||||
return 7.5625 * t * t;
|
||||
}
|
||||
else if (t < 2 / 2.75)
|
||||
{
|
||||
t -= 1.5 / 2.75;
|
||||
return 7.5625 * t * t + 0.75;
|
||||
}
|
||||
else if (t < 2.5 / 2.75)
|
||||
{
|
||||
t -= 2.25 / 2.75;
|
||||
return 7.5625 * t * t + 0.9375;
|
||||
}
|
||||
else
|
||||
{
|
||||
t -= 2.625 / 2.75;
|
||||
return 7.5625 * t * t + 0.984375;
|
||||
}
|
||||
}
|
||||
|
||||
// Función de suavizado
|
||||
double easeOutElastic(double t)
|
||||
{
|
||||
const double c4 = (2 * M_PI) / 3; // Constante para controlar la elasticidad
|
||||
|
||||
return t == 0
|
||||
? 0
|
||||
: (t == 1
|
||||
? 1
|
||||
: pow(2, -10 * t) * sin((t * 10 - 0.75) * c4) + 1);
|
||||
}
|
||||
|
||||
// Comprueba si una vector contiene una cadena
|
||||
bool stringInVector(const std::vector<std::string> &vec, const std::string &str)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user