mirror of
https://github.com/g-truc/glm.git
synced 2024-11-22 17:04:35 +00:00
wrap min/max calls in brackets
This commit is contained in:
parent
33b4a621a6
commit
9921bfb56f
@ -60,7 +60,7 @@ namespace glm
|
||||
//VectorMagnitude to 0. here; we could use denorm_int() compiling a
|
||||
//project with unsafe maths optimizations might make the comparison
|
||||
//always false, even when VectorMagnitude is 0.
|
||||
if (VectorMagnitude < std::numeric_limits<T>::min()) {
|
||||
if (VectorMagnitude < (std::numeric_limits<T>::min)()) {
|
||||
//Equivalent to raising a real number to a power
|
||||
return qua<T, Q>::wxyz(pow(x.w, y), 0, 0, 0);
|
||||
}
|
||||
|
@ -16,8 +16,8 @@ namespace detail
|
||||
{
|
||||
GLM_FUNC_QUALIFIER static vec<L, floatType, Q> call(vec<L, T, Q> const& v)
|
||||
{
|
||||
floatType const Min = static_cast<floatType>(std::numeric_limits<T>::min());
|
||||
floatType const Max = static_cast<floatType>(std::numeric_limits<T>::max());
|
||||
floatType const Min = static_cast<floatType>((std::numeric_limits<T>::min)());
|
||||
floatType const Max = static_cast<floatType>((std::numeric_limits<T>::max)());
|
||||
return (vec<L, floatType, Q>(v) - Min) / (Max - Min) * static_cast<floatType>(2) - static_cast<floatType>(1);
|
||||
}
|
||||
};
|
||||
@ -27,7 +27,7 @@ namespace detail
|
||||
{
|
||||
GLM_FUNC_QUALIFIER static vec<L, floatType, Q> call(vec<L, T, Q> const& v)
|
||||
{
|
||||
return vec<L, floatType, Q>(v) / static_cast<floatType>(std::numeric_limits<T>::max());
|
||||
return vec<L, floatType, Q>(v) / static_cast<floatType>((std::numeric_limits<T>::max)());
|
||||
}
|
||||
};
|
||||
|
||||
@ -49,7 +49,7 @@ namespace detail
|
||||
{
|
||||
GLM_FUNC_QUALIFIER static vec<L, T, Q> call(vec<L, floatType, Q> const& v)
|
||||
{
|
||||
floatType const Max = static_cast<floatType>(std::numeric_limits<T>::max()) + static_cast<floatType>(0.5);
|
||||
floatType const Max = static_cast<floatType>((std::numeric_limits<T>::max)()) + static_cast<floatType>(0.5);
|
||||
vec<L, floatType, Q> const Scaled(v * Max);
|
||||
vec<L, T, Q> const Result(Scaled - static_cast<floatType>(0.5));
|
||||
return Result;
|
||||
@ -61,7 +61,7 @@ namespace detail
|
||||
{
|
||||
GLM_FUNC_QUALIFIER static vec<L, T, Q> call(vec<L, floatType, Q> const& v)
|
||||
{
|
||||
return vec<L, T, Q>(vec<L, floatType, Q>(v) * static_cast<floatType>(std::numeric_limits<T>::max()));
|
||||
return vec<L, T, Q>(vec<L, floatType, Q>(v) * static_cast<floatType>((std::numeric_limits<T>::max)()));
|
||||
}
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user