From 62e56d3f131443908d05a731a07e6b6472ec9fae Mon Sep 17 00:00:00 2001 From: howard-stearns Date: Wed, 28 Oct 2015 16:44:53 -0700 Subject: [PATCH] Don't go to wrong position on startup/teleport. This fixes one cause of being in the wrong place. https://app.asana.com/0/32622044445063/61787931469907 --- interface/src/avatar/MyAvatar.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/interface/src/avatar/MyAvatar.cpp b/interface/src/avatar/MyAvatar.cpp index f7fad2bd2b..4d860b7acd 100644 --- a/interface/src/avatar/MyAvatar.cpp +++ b/interface/src/avatar/MyAvatar.cpp @@ -208,6 +208,11 @@ void MyAvatar::update(float deltaTime) { setPosition(_goToPosition); setOrientation(_goToOrientation); _goToPending = false; + // updateFromHMDSensorMatrix (called from paintGL) expects that the sensorToWorldMatrix is updated for any position changes + // that happen between render and Application::update (which calls updateSensorToWorldMatrix to do so). + // However, render/MyAvatar::update/Application::update don't always match (e.g., when using the separate avatar update thread), + // so we update now. It's ok if it updates again in the normal way. + updateSensorToWorldMatrix(); } if (_referential) {