Moved myAvatar->updateFromHMDSensorMatrix from Application::update back into Application::paintGL, so it occurs between displayPlugin->preRender() and displayPlugin->display(). We should render with the most up-to-date camera position as possible, and sample it at the same frequency as the display rate.
Showing the changes to interface/src/Application.cpp (1 of 3 files). Show all
Unified · Split
| @@ -1055,6 +1055,9 @@ void Application::paintGL() { · 1054 unmodified lines | ||
| 1055 | 1055 | displayPlugin->preRender(); |
| 1056 | 1056 | _offscreenContext->makeCurrent(); |
| 1057 | 1057 | |
| 1058 | + // update the avatar with a fresh HMD pose | |
| 1059 | + _myAvatar->updateFromHMDSensorMatrix(getHMDSensorPose()); | |
| 1060 | + | |
| 1058 | 1061 | auto lodManager = DependencyManager::get<LODManager>(); |
| 1059 | 1062 | |
| 1060 | 1063 | |
| @@ -2895,9 +2898,6 @@ void Application::update(float deltaTime) { · 1834 unmodified lines | ||
| 2895 | 2898 | userInputMapper->getActionState(UserInputMapper::SHIFT), RIGHT_HAND_INDEX); |
| 2896 | 2899 | } |
| 2897 | 2900 | |
| 2898 | − // update the avatar with a fresh HMD pose | |
| 2899 | − _myAvatar->updateFromHMDSensorMatrix(getHMDSensorPose(), deltaTime); | |
| 2900 | − | |
| 2901 | 2901 | updateThreads(deltaTime); // If running non-threaded, then give the threads some time to process... |
| 2902 | 2902 | |
| 2903 | 2903 | updateCamera(deltaTime); // handle various camera tweaks like off axis projection |