Merge pull request #14270 from luiscuenca/softEntitiesLooseJointsFix

Extra joints on soft entities keep their local transform
This commit is contained in:
Anthony Thibault 2018-11-01 09:29:16 -07:00 committed by GitHub
commit 5c78a463de
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -498,8 +498,8 @@ void Avatar::relayJointDataToChildren() {
glm::quat jointRotation;
glm::vec3 jointTranslation;
if (avatarJointIndex < 0) {
jointRotation = modelEntity->getAbsoluteJointRotationInObjectFrame(jointIndex);
jointTranslation = modelEntity->getAbsoluteJointTranslationInObjectFrame(jointIndex);
jointRotation = modelEntity->getLocalJointRotation(jointIndex);
jointTranslation = modelEntity->getLocalJointTranslation(jointIndex);
map.push_back(-1);
} else {
int jointIndex = getJointIndex(jointName);
@ -522,8 +522,8 @@ void Avatar::relayJointDataToChildren() {
jointRotation = getJointRotation(avatarJointIndex);
jointTranslation = getJointTranslation(avatarJointIndex);
} else {
jointRotation = modelEntity->getAbsoluteJointRotationInObjectFrame(jointIndex);
jointTranslation = modelEntity->getAbsoluteJointTranslationInObjectFrame(jointIndex);
jointRotation = modelEntity->getLocalJointRotation(jointIndex);
jointTranslation = modelEntity->getLocalJointTranslation(jointIndex);
}
modelEntity->setLocalJointRotation(jointIndex, jointRotation);
modelEntity->setLocalJointTranslation(jointIndex, jointTranslation);