mirror of
https://github.com/overte-org/overte.git
synced 2025-08-07 19:50:38 +02:00
Merge pull request #12655 from hyperlogic/bug-fix/hand-ik-glitch
Fix for hand IK jitter
This commit is contained in:
commit
652ca98ebf
1 changed files with 5 additions and 9 deletions
|
@ -66,16 +66,12 @@ bool ElbowConstraint::apply(glm::quat& rotation) const {
|
||||||
bool twistWasClamped = (twistAngle != clampedTwistAngle);
|
bool twistWasClamped = (twistAngle != clampedTwistAngle);
|
||||||
|
|
||||||
// update rotation
|
// update rotation
|
||||||
const float MIN_SWING_REAL_PART = 0.99999f;
|
|
||||||
if (twistWasClamped || fabsf(swingRotation.w) < MIN_SWING_REAL_PART) {
|
|
||||||
if (twistWasClamped) {
|
if (twistWasClamped) {
|
||||||
twistRotation = glm::angleAxis(clampedTwistAngle, _axis);
|
twistRotation = glm::angleAxis(clampedTwistAngle, _axis);
|
||||||
}
|
}
|
||||||
// we discard all swing and only keep twist
|
// we discard all swing and only keep twist
|
||||||
rotation = twistRotation * _referenceRotation;
|
rotation = twistRotation * _referenceRotation;
|
||||||
return true;
|
return true;
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
glm::quat ElbowConstraint::computeCenterRotation() const {
|
glm::quat ElbowConstraint::computeCenterRotation() const {
|
||||||
|
|
Loading…
Reference in a new issue