From 9394a25a1c9674a2896c4d8979b6e26270e935c4 Mon Sep 17 00:00:00 2001 From: Seth Alves Date: Fri, 26 Aug 2016 12:47:19 -0700 Subject: [PATCH] remove some anti-jitter code that was doing more harm than good --- interface/src/avatar/MyAvatar.cpp | 18 +----------------- 1 file changed, 1 insertion(+), 17 deletions(-) diff --git a/interface/src/avatar/MyAvatar.cpp b/interface/src/avatar/MyAvatar.cpp index 1d543b4ed5..50baabc844 100644 --- a/interface/src/avatar/MyAvatar.cpp +++ b/interface/src/avatar/MyAvatar.cpp @@ -540,24 +540,8 @@ void MyAvatar::updateJointFromController(glm::mat4& previousSensorToWorldInverse Transform transform; transform.setTranslation(controllerPose.getTranslation()); transform.setRotation(controllerPose.getRotation()); - glm::mat4 avatarMatrix = getTransform().getMatrix(); - glm::mat4 avatarInverseMatrix = glm::inverse(avatarMatrix); - - // do some backflips to avoid jitter - - // get the controller pose (avatar space) glm::mat4 controllerMatrix = transform.getMatrix(); - // transform the controller pose into world space. - glm::mat4 controllerWorldSpace = avatarMatrix * controllerMatrix; - // transform the controller pose from world space into sensor space. But use the inverse of the ORIGINAL sensorToWorld - // matrix before updateSensorToWorldMatrix() changes it. - glm::mat4 controllerPreviousSensor = previousSensorToWorldInverseMatrix * controllerWorldSpace; - // then transform the sensor space controller pose back into world space using the NEW sensorToWorld matrix. - glm::mat4 controllerNewWorldSpace = _sensorToWorldMatrix * controllerPreviousSensor; - // then transform that world pose back into avatar space. - glm::mat4 newControllerMatrix = avatarInverseMatrix * controllerNewWorldSpace; - - matrixCache.set(newControllerMatrix); + matrixCache.set(controllerMatrix); } // best called at end of main loop, after physics.