Fixed GTX_easying clang warnings

This commit is contained in:
Christophe Riccio 2018-05-08 14:01:29 +02:00
parent c3a41b0ef8
commit e2b75b6bf7
2 changed files with 13 additions and 14 deletions

View File

@ -185,16 +185,19 @@ namespace glm{
template <typename genType>
GLM_FUNC_DECL genType backEaseInOut(genType const& a);
/// @param a parameter
/// @param o Optional overshoot modifier
/// @see gtx_easing
template <typename genType>
GLM_FUNC_DECL genType backEaseIn(genType const& a, genType const& o);
/// @param a parameter
/// @param o Optional overshoot modifier
/// @see gtx_easing
template <typename genType>
GLM_FUNC_DECL genType backEaseOut(genType const& a, genType const& o);
/// @param a parameter
/// @param o Optional overshoot modifier
/// @see gtx_easing
template <typename genType>

View File

@ -119,7 +119,7 @@ namespace glm{
assert(a >= zero<genType>());
assert(a <= one<genType>());
if (a < static_cast<genType>(0.5))
if(a < static_cast<genType>(0.5))
{
return static_cast<genType>(8) * a * a * a * a;
}
@ -158,7 +158,7 @@ namespace glm{
assert(a >= zero<genType>());
assert(a <= one<genType>());
if (a < static_cast<genType>(0.5))
if(a < static_cast<genType>(0.5))
{
return static_cast<genType>(16) * a * a * a * a * a;
}
@ -243,7 +243,10 @@ namespace glm{
assert(a >= zero<genType>());
assert(a <= one<genType>());
return (a == zero<genType>()) ? a : pow<genType>(static_cast<genType>(2), static_cast<genType>(10) * (a - one<genType>()));
if(a <= zero<genType>())
return a;
else
return pow<genType>(static_cast<genType>(2), static_cast<genType>(10) * (a - one<genType>()));
}
template <typename genType>
@ -253,7 +256,10 @@ namespace glm{
assert(a >= zero<genType>());
assert(a <= one<genType>());
return (a == one<genType>()) ? a : one<genType>() - pow<genType>(static_cast<genType>(2), -static_cast<genType>(10) * a);
if(a >= one<genType>())
return a;
else
return one<genType>() - pow<genType>(static_cast<genType>(2), -static_cast<genType>(10) * a);
}
template <typename genType>
@ -263,16 +269,10 @@ namespace glm{
assert(a >= zero<genType>());
assert(a <= one<genType>());
if(a == zero<genType>() || a == one<genType>()) return a;
if(a < static_cast<genType>(0.5))
{
return static_cast<genType>(0.5) * pow<genType>(static_cast<genType>(2), (static_cast<genType>(20) * a) - static_cast<genType>(10));
}
else
{
return -static_cast<genType>(0.5) * pow<genType>(static_cast<genType>(2), (-static_cast<genType>(20) * a) + static_cast<genType>(10)) + one<genType>();
}
}
template <typename genType>
@ -303,13 +303,9 @@ namespace glm{
assert(a <= one<genType>());
if(a < static_cast<genType>(0.5))
{
return static_cast<genType>(0.5) * sin(static_cast<genType>(13) * half_pi<genType>() * (static_cast<genType>(2) * a)) * pow<genType>(static_cast<genType>(2), static_cast<genType>(10) * ((static_cast<genType>(2) * a) - one<genType>()));
}
else
{
return static_cast<genType>(0.5) * (sin(-static_cast<genType>(13) * half_pi<genType>() * ((static_cast<genType>(2) * a - one<genType>()) + one<genType>())) * pow<genType>(static_cast<genType>(2), -static_cast<genType>(10) * (static_cast<genType>(2) * a - one<genType>())) + static_cast<genType>(2));
}
}
template <typename genType>