Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

glm::clamp and NaN's #18

Closed
BartSiwek opened this issue Dec 12, 2012 · 1 comment
Closed

glm::clamp and NaN's #18

BartSiwek opened this issue Dec 12, 2012 · 1 comment
Assignees
Labels
Milestone

Comments

@BartSiwek
Copy link

The clamp function seems to handle NaN's in a bad manner. Result of

glm::clamp(std::numeric_limits<float>::quite_NaN(), a, b)

is b while it should be a NaN.

This can be fixed by modifying the clamp function. Now its

return max(min(x, maxVal), minVal)

It should be

return min(maxVal, max(minVal, x));
@ghost ghost assigned Groovounet Dec 13, 2012
Groovounet pushed a commit that referenced this issue Dec 13, 2012
@Groovounet
Copy link
Member

This bug is now fixed in GLM 0.9.4 branch for GLM 0.9.4.1 released.

Thanks for contributing!
Christophe

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants