mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-05-05 19:58:15 +02:00
Fix for arms' getting twisted up with new IK.
This commit is contained in:
parent
18251d7251
commit
4a23c0cfd9
1 changed files with 4 additions and 6 deletions
|
@ -334,13 +334,11 @@ void SkeletonModel::setHandPosition(int jointIndex, const glm::vec3& position, c
|
||||||
|
|
||||||
glm::vec3 forwardVector(rightHand ? -1.0f : 1.0f, 0.0f, 0.0f);
|
glm::vec3 forwardVector(rightHand ? -1.0f : 1.0f, 0.0f, 0.0f);
|
||||||
|
|
||||||
glm::quat shoulderRotation;
|
glm::quat shoulderRotation = rotationBetween(forwardVector, elbowPosition - shoulderPosition);
|
||||||
getJointRotation(shoulderJointIndex, shoulderRotation, true);
|
setJointRotation(shoulderJointIndex, shoulderRotation, true);
|
||||||
applyRotationDelta(shoulderJointIndex, rotationBetween(shoulderRotation * forwardVector, elbowPosition - shoulderPosition), false);
|
|
||||||
|
|
||||||
glm::quat elbowRotation;
|
setJointRotation(elbowJointIndex, rotationBetween(shoulderRotation * forwardVector,
|
||||||
getJointRotation(elbowJointIndex, elbowRotation, true);
|
wristPosition - elbowPosition) * shoulderRotation, true);
|
||||||
applyRotationDelta(elbowJointIndex, rotationBetween(elbowRotation * forwardVector, wristPosition - elbowPosition), false);
|
|
||||||
|
|
||||||
setJointRotation(jointIndex, rotation, true);
|
setJointRotation(jointIndex, rotation, true);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue