Clear the brush, clear the cobwebs, and set the other orientations now that we're clear on what coordinate system we're in.

This commit is contained in:
Howard Stearns 2015-08-25 09:55:04 -07:00
parent 476ca36460
commit 2ed6900c7e

View file

@ -137,15 +137,14 @@ void SkeletonModel::updateRig(float deltaTime, glm::mat4 parentTransform) {
// If the head is not positioned, updateEyeJoints won't get the math right
glm::quat headOrientation;
_rig->getJointRotation(geometry.headJointIndex, headOrientation);
glm::quat modelOrientation = getRotation();
glm::quat adjust = modelOrientation;
glm::quat headOrientationInAvatar = adjust * headOrientation;
glm::vec3 eulers = safeEulerAngles(headOrientationInAvatar);
glm::vec3 eulers = safeEulerAngles(headOrientation);
head->setBasePitch(glm::degrees(-eulers.x));
head->setBaseYaw(glm::degrees(eulers.y));
head->setBaseRoll(glm::degrees(-eulers.z));
_rig->updateEyeJoints(geometry.leftEyeJointIndex, geometry.rightEyeJointIndex,
getTranslation(), modelOrientation,
getTranslation(), getRotation(),
head->getFinalOrientationInWorldFrame(), head->getCorrectedLookAtPosition());
}
}
}
// Called by Avatar::simulate after it has set the joint states (fullUpdate true if changed),