Found and disabled torso twist use an old copy of the hmd pose before physics, and the most up to date one after physics.
Showing the changes to interface/src/Application.cpp (1 of 8 files). Show all
Unified · Split
| @@ -2670,6 +2670,10 @@ void Application::update(float deltaTime) { · 2669 unmodified lines | |||
| 2670 | _physicsEngine.stepSimulation(); | 2670 | _physicsEngine.stepSimulation(); |
| 2671 | _entities.getTree()->unlock(); | 2671 | _entities.getTree()->unlock(); |
| 2672 | 2672 | ||
| 2673 | // AJT: delay the head pose until after the physics step. | ||
| 2674 | _headPosition = glm::vec3(getActiveDisplayPlugin()->getHeadPose()[3]); | ||
| 2675 | _headOrientation = glm::quat_cast(getActiveDisplayPlugin()->getHeadPose()); | ||
| 2676 | |||
| 2673 | if (_physicsEngine.hasOutgoingChanges()) { | 2677 | if (_physicsEngine.hasOutgoingChanges()) { |
| 2674 | _entities.getTree()->lockForWrite(); | 2678 | _entities.getTree()->lockForWrite(); |
| 2675 | _entitySimulation.lock(); | 2679 | _entitySimulation.lock(); |
| @@ -4865,11 +4869,11 @@ void Application::shutdownPlugins() { · 2189 unmodified lines | |||
| 4865 | } | 4869 | } |
| 4866 | 4870 | ||
| 4867 | glm::vec3 Application::getHeadPosition() const { | 4871 | glm::vec3 Application::getHeadPosition() const { |
| 4868 | return glm::vec3(getActiveDisplayPlugin()->getHeadPose()[3]); | 4872 | return _headPosition; |
| 4869 | } | 4873 | } |
| 4870 | 4874 | ||
| 4871 | glm::quat Application::getHeadOrientation() const { | 4875 | glm::quat Application::getHeadOrientation() const { |
| 4872 | return glm::quat_cast(getActiveDisplayPlugin()->getHeadPose()); | 4876 | return _headOrientation; |
| 4873 | } | 4877 | } |
| 4874 | 4878 | ||
| 4875 | glm::uvec2 Application::getCanvasSize() const { | 4879 | glm::uvec2 Application::getCanvasSize() const { |