/// @ref gtx_extended_min_max /// @file glm/gtx/extended_min_max.inl namespace glm { template GLM_FUNC_QUALIFIER T min( T const& x, T const& y, T const& z) { return glm::min(glm::min(x, y), z); } template class C> GLM_FUNC_QUALIFIER C min ( C const& x, typename C::T const& y, typename C::T const& z ) { return glm::min(glm::min(x, y), z); } template class C> GLM_FUNC_QUALIFIER C min ( C const& x, C const& y, C const& z ) { return glm::min(glm::min(x, y), z); } template GLM_FUNC_QUALIFIER T min ( 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> GLM_FUNC_QUALIFIER C min ( 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> GLM_FUNC_QUALIFIER C min ( C const& x, C const& y, C const& z, C const& w ) { return glm::min(glm::min(x, y), glm::min(z, w)); } template GLM_FUNC_QUALIFIER T max( T const& x, T const& y, T const& z) { return glm::max(glm::max(x, y), z); } template class C> GLM_FUNC_QUALIFIER C max ( C const& x, typename C::T const& y, typename C::T const& z ) { return glm::max(glm::max(x, y), z); } template class C> GLM_FUNC_QUALIFIER C max ( C const& x, C const& y, C const& z ) { return glm::max(glm::max(x, y), z); } template GLM_FUNC_QUALIFIER T max ( 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> GLM_FUNC_QUALIFIER C max ( 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> GLM_FUNC_QUALIFIER C max ( 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