Fixed round function

This commit is contained in:
Christophe Riccio 2011-09-16 09:44:06 +01:00
parent e42e112469
commit 91b8ae9c6e

View File

@ -225,6 +225,8 @@ namespace glm
{ {
GLM_STATIC_ASSERT(detail::type<genType>::is_float, "'round' only accept floating-point inputs"); GLM_STATIC_ASSERT(detail::type<genType>::is_float, "'round' only accept floating-point inputs");
if(x < 0)
return genType(int(x - genType(0.5)));
return genType(int(x + genType(0.5))); return genType(int(x + genType(0.5)));
} }