mirror of
https://github.com/g-truc/glm.git
synced 2025-04-06 22:15:00 +00:00
Fixed issue #18 glm::clamp and NaN's
This commit is contained in:
parent
a7fb9f31fd
commit
931b7bcdd6
1 changed files with 1 additions and 5 deletions
|
@ -332,11 +332,7 @@ namespace detail
|
|||
detail::type<valType>::is_int ||
|
||||
detail::type<valType>::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 <typename T>
|
||||
|
|
Loading…
Add table
Reference in a new issue