Merge pull request #2990 from AndrewMeadows/bug-fix

fix for broken windows build with PrioVR libs
This commit is contained in:
Andrzej Kapolka 2014-06-05 17:04:58 -07:00
commit 981d0eb36e

View file

@ -76,20 +76,21 @@ static void setPalm(float deltaTime, int index) {
} }
} }
// NOTE: this math is done in the worl-frame with unecessary complexity.
// TODO: transfom this to stay in the model-frame.
glm::vec3 position; glm::vec3 position;
glm::quat rotation; glm::quat rotation;
SkeletonModel* skeletonModel = &Application::getInstance()->getAvatar()->getSkeletonModel(); SkeletonModel* skeletonModel = &Application::getInstance()->getAvatar()->getSkeletonModel();
int jointIndex; int jointIndex;
glm::quat inverseRotation = glm::inverse(Application::getInstance()->getAvatar()->getOrientation()); glm::quat inverseRotation = glm::inverse(Application::getInstance()->getAvatar()->getOrientation());
if (index == LEFT_HAND_INDEX) { if (index == LEFT_HAND_INDEX) {
jointIndex = skeletonModel->getLeftHandJointIndex(); jointIndex = skeletonModel->getLeftHandJointIndex();
skeletonModel->getJointRotation(jointIndex, rotation, true); skeletonModel->getJointRotationInWorldFrame(jointIndex, rotation);
rotation = inverseRotation * rotation * glm::quat(glm::vec3(0.0f, PI_OVER_TWO, 0.0f)); rotation = inverseRotation * rotation * glm::quat(glm::vec3(0.0f, PI_OVER_TWO, 0.0f));
} else { } else {
jointIndex = skeletonModel->getRightHandJointIndex(); jointIndex = skeletonModel->getRightHandJointIndex();
skeletonModel->getJointRotation(jointIndex, rotation, true); skeletonModel->getJointRotationInWorldFrame(jointIndex, rotation);
rotation = inverseRotation * rotation * glm::quat(glm::vec3(0.0f, -PI_OVER_TWO, 0.0f)); rotation = inverseRotation * rotation * glm::quat(glm::vec3(0.0f, -PI_OVER_TWO, 0.0f));
} }
skeletonModel->getJointPositionInWorldFrame(jointIndex, position); skeletonModel->getJointPositionInWorldFrame(jointIndex, position);