3
0
Fork 0
mirror of https://github.com/lubosz/overte.git synced 2025-04-26 19:35:48 +02:00

use glm::clamp() instead if std::max() and min()

This commit is contained in:
Andrew Meadows 2015-08-10 23:08:36 -07:00
parent 4655bd21dd
commit a38c1c82d1

View file

@ -62,7 +62,7 @@ bool ElbowConstraint::apply(glm::quat& rotation) const {
twistAngle *= copysignf(1.0f, glm::dot(glm::cross(_perpAxis, twisted), _axis));
// clamp twistAngle
float clampedTwistAngle = std::max(_minAngle, std::min(twistAngle, _maxAngle));
float clampedTwistAngle = glm::clamp(twistAngle, _minAngle, _maxAngle);
bool twistWasClamped = (twistAngle != clampedTwistAngle);
// update rotation