From 2877f4eda3d1b0c7431039e3142ecf1a282a34b1 Mon Sep 17 00:00:00 2001 From: LaG1924 <12997935+LaG1924@users.noreply.github.com> Date: Tue, 21 Aug 2018 20:40:38 +0500 Subject: Update glm to 0.9.9.0 --- external/include/glm/gtx/extended_min_max.inl | 187 ++++++++++++++++++-------- 1 file changed, 133 insertions(+), 54 deletions(-) (limited to 'external/include/glm/gtx/extended_min_max.inl') diff --git a/external/include/glm/gtx/extended_min_max.inl b/external/include/glm/gtx/extended_min_max.inl index 64ea445..ac3dd64 100644 --- a/external/include/glm/gtx/extended_min_max.inl +++ b/external/include/glm/gtx/extended_min_max.inl @@ -3,138 +3,217 @@ namespace glm { - template + template GLM_FUNC_QUALIFIER T min( - T const & x, - T const & y, - T const & z) + T const& x, + T const& y, + T const& z) { return glm::min(glm::min(x, y), z); } - template class C> + template class C> GLM_FUNC_QUALIFIER C min ( - C const & x, - typename C::T const & y, - typename C::T const & z + C const& x, + typename C::T const& y, + typename C::T const& z ) { return glm::min(glm::min(x, y), z); } - template class C> + template class C> GLM_FUNC_QUALIFIER C min ( - C const & x, - C const & y, - C const & z + C const& x, + C const& y, + C const& z ) { return glm::min(glm::min(x, y), z); } - template + template GLM_FUNC_QUALIFIER T min ( - T const & x, - T const & y, - T const & z, - T const & w + T const& x, + T const& y, + T const& z, + T const& w ) { return glm::min(glm::min(x, y), glm::min(z, w)); } - template class C> + template class C> GLM_FUNC_QUALIFIER C min ( - C const & x, - typename C::T const & y, - typename C::T const & z, - typename C::T const & w + C const& x, + typename C::T const& y, + typename C::T const& z, + typename C::T const& w ) { return glm::min(glm::min(x, y), glm::min(z, w)); } - template class C> + template class C> GLM_FUNC_QUALIFIER C min ( - C const & x, - C const & y, - C const & z, - C const & w + C const& x, + C const& y, + C const& z, + C const& w ) { return glm::min(glm::min(x, y), glm::min(z, w)); } - template + template GLM_FUNC_QUALIFIER T max( - T const & x, - T const & y, - T const & z) + T const& x, + T const& y, + T const& z) { return glm::max(glm::max(x, y), z); } - template class C> + template class C> GLM_FUNC_QUALIFIER C max ( - C const & x, - typename C::T const & y, - typename C::T const & z + C const& x, + typename C::T const& y, + typename C::T const& z ) { return glm::max(glm::max(x, y), z); } - template class C> + template class C> GLM_FUNC_QUALIFIER C max ( - C const & x, - C const & y, - C const & z + C const& x, + C const& y, + C const& z ) { return glm::max(glm::max(x, y), z); } - template + template GLM_FUNC_QUALIFIER T max ( - T const & x, - T const & y, - T const & z, - T const & w + T const& x, + T const& y, + T const& z, + T const& w ) { return glm::max(glm::max(x, y), glm::max(z, w)); } - template class C> + template class C> GLM_FUNC_QUALIFIER C max ( - C const & x, - typename C::T const & y, - typename C::T const & z, - typename C::T const & w + C const& x, + typename C::T const& y, + typename C::T const& z, + typename C::T const& w ) { return glm::max(glm::max(x, y), glm::max(z, w)); } - template class C> + template class C> GLM_FUNC_QUALIFIER C max ( - C const & x, - C const & y, - C const & z, - C const & w + C const& x, + C const& y, + C const& z, + C const& w ) { return glm::max(glm::max(x, y), glm::max(z, w)); } + // fmin +# if GLM_HAS_CXX11_STL + using std::fmin; +# else + template + GLM_FUNC_QUALIFIER genType fmin(genType x, genType y) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'fmin' only accept floating-point input"); + + if (isnan(x)) + return y; + if (isnan(y)) + return x; + + return min(x, y); + } +# endif + + template + GLM_FUNC_QUALIFIER vec fmin(vec const& a, T b) + { + return detail::functor2::call(fmin, a, vec(b)); + } + + template + GLM_FUNC_QUALIFIER vec fmin(vec const& a, vec const& b) + { + return detail::functor2::call(fmin, a, b); + } + + // fmax +# if GLM_HAS_CXX11_STL + using std::fmax; +# else + template + GLM_FUNC_QUALIFIER genType fmax(genType x, genType y) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'fmax' only accept floating-point input"); + + if (isnan(x)) + return y; + if (isnan(y)) + return x; + + return max(x, y); + } +# endif + + template + GLM_FUNC_QUALIFIER vec fmax(vec const& a, T b) + { + return detail::functor2::call(fmax, a, vec(b)); + } + + template + GLM_FUNC_QUALIFIER vec fmax(vec const& a, vec const& b) + { + return detail::functor2::call(fmax, a, b); + } + + // fclamp + template + GLM_FUNC_QUALIFIER genType fclamp(genType x, genType minVal, genType maxVal) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'fclamp' only accept floating-point or integer inputs"); + return fmin(fmax(x, minVal), maxVal); + } + + template + GLM_FUNC_QUALIFIER vec fclamp(vec const& x, T minVal, T maxVal) + { + return fmin(fmax(x, vec(minVal)), vec(maxVal)); + } + + template + GLM_FUNC_QUALIFIER vec fclamp(vec const& x, vec const& minVal, vec const& maxVal) + { + return fmin(fmax(x, minVal), maxVal); + } }//namespace glm -- cgit v1.2.3