mirror of
https://github.com/g-truc/glm.git
synced 2024-11-26 02:04:35 +00:00
fix: generalize epsilonEqual
This commit is contained in:
parent
fc8f4bb442
commit
a063df8336
@ -6,24 +6,8 @@
|
|||||||
|
|
||||||
namespace glm
|
namespace glm
|
||||||
{
|
{
|
||||||
template<>
|
template<typename genType>
|
||||||
GLM_FUNC_QUALIFIER bool epsilonEqual
|
GLM_FUNC_QUALIFIER bool epsilonEqual(genType const& x, genType const& y, genType const& epsilon)
|
||||||
(
|
|
||||||
float const& x,
|
|
||||||
float const& y,
|
|
||||||
float const& epsilon
|
|
||||||
)
|
|
||||||
{
|
|
||||||
return abs(x - y) < epsilon;
|
|
||||||
}
|
|
||||||
|
|
||||||
template<>
|
|
||||||
GLM_FUNC_QUALIFIER bool epsilonEqual
|
|
||||||
(
|
|
||||||
double const& x,
|
|
||||||
double const& y,
|
|
||||||
double const& epsilon
|
|
||||||
)
|
|
||||||
{
|
{
|
||||||
return abs(x - y) < epsilon;
|
return abs(x - y) < epsilon;
|
||||||
}
|
}
|
||||||
@ -40,14 +24,8 @@ namespace glm
|
|||||||
return lessThan(abs(x - y), vec<L, T, Q>(epsilon));
|
return lessThan(abs(x - y), vec<L, T, Q>(epsilon));
|
||||||
}
|
}
|
||||||
|
|
||||||
template<>
|
template<typename genType>
|
||||||
GLM_FUNC_QUALIFIER bool epsilonNotEqual(float const& x, float const& y, float const& epsilon)
|
GLM_FUNC_QUALIFIER bool epsilonNotEqual(genType const& x, genType const& y, genType const& epsilon)
|
||||||
{
|
|
||||||
return abs(x - y) >= epsilon;
|
|
||||||
}
|
|
||||||
|
|
||||||
template<>
|
|
||||||
GLM_FUNC_QUALIFIER bool epsilonNotEqual(double const& x, double const& y, double const& epsilon)
|
|
||||||
{
|
{
|
||||||
return abs(x - y) >= epsilon;
|
return abs(x - y) >= epsilon;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user