Fixed issue #18 glm::clamp and NaN's
This commit is contained in:
parent
a7fb9f31fd
commit
931b7bcdd6
@ -332,11 +332,7 @@ namespace detail
|
|||||||
detail::type<valType>::is_int ||
|
detail::type<valType>::is_int ||
|
||||||
detail::type<valType>::is_uint, "'clamp' only accept numbers");
|
detail::type<valType>::is_uint, "'clamp' only accept numbers");
|
||||||
|
|
||||||
// Old implementation, less predictable branching
|
return min(maxVal, max(minVal, x));
|
||||||
//if(x >= maxVal) return maxVal;
|
|
||||||
//if(x <= minVal) return minVal;
|
|
||||||
//return x;
|
|
||||||
return max(min(x, maxVal), minVal);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename T>
|
template <typename T>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user