From 931b7bcdd6a284ecc04d3bb2344e5a0fe8efef2d Mon Sep 17 00:00:00 2001 From: Christophe Riccio Date: Thu, 13 Dec 2012 11:26:59 +0100 Subject: [PATCH] Fixed issue #18 glm::clamp and NaN's --- glm/core/func_common.inl | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/glm/core/func_common.inl b/glm/core/func_common.inl index 848ee88e..14504d18 100644 --- a/glm/core/func_common.inl +++ b/glm/core/func_common.inl @@ -332,11 +332,7 @@ namespace detail detail::type::is_int || detail::type::is_uint, "'clamp' only accept numbers"); - // Old implementation, less predictable branching - //if(x >= maxVal) return maxVal; - //if(x <= minVal) return minVal; - //return x; - return max(min(x, maxVal), minVal); + return min(maxVal, max(minVal, x)); } template