From 2ed6900c7e2f717da5728fb9f6edd1a07bbb7dc4 Mon Sep 17 00:00:00 2001 From: Howard Stearns Date: Tue, 25 Aug 2015 09:55:04 -0700 Subject: [PATCH] Clear the brush, clear the cobwebs, and set the other orientations now that we're clear on what coordinate system we're in. --- interface/src/avatar/SkeletonModel.cpp | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/interface/src/avatar/SkeletonModel.cpp b/interface/src/avatar/SkeletonModel.cpp index c80992feec..93da3c673e 100644 --- a/interface/src/avatar/SkeletonModel.cpp +++ b/interface/src/avatar/SkeletonModel.cpp @@ -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),