Fix for Hydra scaling

This PR fixes the hydra (and probably other hand controllers) while scaling.

Testing notes:
- Enable your hydra's
- Grow your avatar (x5 or x10) (With the `+` key)
- Spreading your arms in a T-pose should work without any scaling issues
- Reset your scale using the `=` key
This commit is contained in:
Thijs Wenker 2016-01-31 23:39:43 +01:00
parent ef380ca38c
commit 8f6e7018bd

View file

@ -5007,7 +5007,7 @@ void Application::setPalmData(Hand* hand, const controller::Pose& pose, float de
palm.setActive(pose.isValid());
// transform from sensor space, to world space, to avatar model space.
glm::mat4 poseMat = createMatFromQuatAndPos(pose.getRotation(), pose.getTranslation());
glm::mat4 poseMat = createMatFromQuatAndPos(pose.getRotation(), pose.getTranslation() * myAvatar->getScale());
glm::mat4 sensorToWorldMat = myAvatar->getSensorToWorldMatrix();
glm::mat4 modelMat = createMatFromQuatAndPos(myAvatar->getOrientation(), myAvatar->getPosition());
glm::mat4 objectPose = glm::inverse(modelMat) * sensorToWorldMat * poseMat;