From 8f6e7018bd08b273483e2ca81a84b387fefb4991 Mon Sep 17 00:00:00 2001 From: Thijs Wenker Date: Sun, 31 Jan 2016 23:39:43 +0100 Subject: [PATCH] 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 --- interface/src/Application.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/interface/src/Application.cpp b/interface/src/Application.cpp index bd571b9f5e..fd2b7a32d3 100644 --- a/interface/src/Application.cpp +++ b/interface/src/Application.cpp @@ -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;