|
|
@ -200,8 +200,6 @@ namespace detail |
|
|
|
"'sign' only accept signed inputs"); |
|
|
|
"'sign' only accept signed inputs"); |
|
|
|
|
|
|
|
|
|
|
|
return detail::compute_sign<T, P, vecType, std::numeric_limits<T>::is_iec559>::call(x); |
|
|
|
return detail::compute_sign<T, P, vecType, std::numeric_limits<T>::is_iec559>::call(x); |
|
|
|
|
|
|
|
|
|
|
|
//return vecType<T, P>(glm::lessThan(vecType<T, P>(0), x)) - vecType<T, P>(glm::lessThan(x, vecType<T, P>(0))); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// floor |
|
|
|
// floor |
|
|
@ -506,7 +504,7 @@ namespace detail |
|
|
|
{ |
|
|
|
{ |
|
|
|
GLM_STATIC_ASSERT(std::numeric_limits<genType>::is_iec559, "'smoothstep' only accept floating-point inputs"); |
|
|
|
GLM_STATIC_ASSERT(std::numeric_limits<genType>::is_iec559, "'smoothstep' only accept floating-point inputs"); |
|
|
|
|
|
|
|
|
|
|
|
genType tmp = clamp((x - edge0) / (edge1 - edge0), genType(0), genType(1)); |
|
|
|
genType const tmp(clamp((x - edge0) / (edge1 - edge0), genType(0), genType(1))); |
|
|
|
return tmp * tmp * (genType(3) - genType(2) * tmp); |
|
|
|
return tmp * tmp * (genType(3) - genType(2) * tmp); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -515,7 +513,7 @@ namespace detail |
|
|
|
{ |
|
|
|
{ |
|
|
|
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'smoothstep' only accept floating-point inputs"); |
|
|
|
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'smoothstep' only accept floating-point inputs"); |
|
|
|
|
|
|
|
|
|
|
|
vecType<T, P> tmp = clamp((x - edge0) / (edge1 - edge0), static_cast<T>(0), static_cast<T>(1)); |
|
|
|
vecType<T, P> const tmp(clamp((x - edge0) / (edge1 - edge0), static_cast<T>(0), static_cast<T>(1))); |
|
|
|
return tmp * tmp * (static_cast<T>(3) - static_cast<T>(2) * tmp); |
|
|
|
return tmp * tmp * (static_cast<T>(3) - static_cast<T>(2) * tmp); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -524,11 +522,14 @@ namespace detail |
|
|
|
{ |
|
|
|
{ |
|
|
|
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'smoothstep' only accept floating-point inputs"); |
|
|
|
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'smoothstep' only accept floating-point inputs"); |
|
|
|
|
|
|
|
|
|
|
|
vecType<T, P> tmp = clamp((x - edge0) / (edge1 - edge0), static_cast<T>(0), static_cast<T>(1)); |
|
|
|
vecType<T, P> const tmp(clamp((x - edge0) / (edge1 - edge0), static_cast<T>(0), static_cast<T>(1))); |
|
|
|
return tmp * tmp * (static_cast<T>(3) - static_cast<T>(2) * tmp); |
|
|
|
return tmp * tmp * (static_cast<T>(3) - static_cast<T>(2) * tmp); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// TODO: Not working on MinGW... |
|
|
|
// TODO: Not working on MinGW... |
|
|
|
|
|
|
|
# if GLM_HAS_CXX11_STL |
|
|
|
|
|
|
|
usign std::isnan; |
|
|
|
|
|
|
|
# else |
|
|
|
template <typename genType> |
|
|
|
template <typename genType> |
|
|
|
GLM_FUNC_QUALIFIER bool isnan(genType x) |
|
|
|
GLM_FUNC_QUALIFIER bool isnan(genType x) |
|
|
|
{ |
|
|
|
{ |
|
|
@ -550,6 +551,7 @@ namespace detail |
|
|
|
return std::isnan(x); |
|
|
|
return std::isnan(x); |
|
|
|
# endif |
|
|
|
# endif |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
# endif |
|
|
|
|
|
|
|
|
|
|
|
template <typename T, precision P, template <typename, precision> class vecType> |
|
|
|
template <typename T, precision P, template <typename, precision> class vecType> |
|
|
|
GLM_FUNC_QUALIFIER vecType<bool, P> isnan(vecType<T, P> const & x) |
|
|
|
GLM_FUNC_QUALIFIER vecType<bool, P> isnan(vecType<T, P> const & x) |
|
|
@ -559,6 +561,9 @@ namespace detail |
|
|
|
return detail::functor1<bool, T, P, vecType>::call(isnan, x); |
|
|
|
return detail::functor1<bool, T, P, vecType>::call(isnan, x); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# if GLM_HAS_CXX11_STL |
|
|
|
|
|
|
|
using std::isinf; |
|
|
|
|
|
|
|
# else |
|
|
|
template <typename genType> |
|
|
|
template <typename genType> |
|
|
|
GLM_FUNC_QUALIFIER bool isinf(genType x) |
|
|
|
GLM_FUNC_QUALIFIER bool isinf(genType x) |
|
|
|
{ |
|
|
|
{ |
|
|
@ -581,6 +586,7 @@ namespace detail |
|
|
|
return std::isinf(x); |
|
|
|
return std::isinf(x); |
|
|
|
# endif |
|
|
|
# endif |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
# endif |
|
|
|
|
|
|
|
|
|
|
|
template <typename T, precision P, template <typename, precision> class vecType> |
|
|
|
template <typename T, precision P, template <typename, precision> class vecType> |
|
|
|
GLM_FUNC_QUALIFIER vecType<bool, P> isinf(vecType<T, P> const & x) |
|
|
|
GLM_FUNC_QUALIFIER vecType<bool, P> isinf(vecType<T, P> const & x) |
|
|
|