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
This commit is contained in:
howard-stearns 2015-10-28 16:44:53 -07:00
parent 170725418b
commit 62e56d3f13

View file

@ -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) {