From 7432c8361e9b809640e9779135fa7733e8bd702f Mon Sep 17 00:00:00 2001 From: Olivier Prat Date: Fri, 23 Feb 2018 09:11:17 +0100 Subject: [PATCH] Added some comments to try to help understand the correction pipeline --- .../src/display-plugins/hmd/HmdDisplayPlugin.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/libraries/display-plugins/src/display-plugins/hmd/HmdDisplayPlugin.cpp b/libraries/display-plugins/src/display-plugins/hmd/HmdDisplayPlugin.cpp index f93178cf20..172a153f65 100644 --- a/libraries/display-plugins/src/display-plugins/hmd/HmdDisplayPlugin.cpp +++ b/libraries/display-plugins/src/display-plugins/hmd/HmdDisplayPlugin.cpp @@ -341,7 +341,10 @@ void HmdDisplayPlugin::updateFrameData() { auto invBatchPose = glm::inverse(_currentFrame->pose); auto invPrevBatchPose = glm::inverse(_currentFrame->prevPose); auto correction = invBatchPose * _currentPresentFrameInfo.presentPose; - auto prevCorrection = /*_currentFrame->prevView * glm::inverse(_prevRenderView) */ invPrevBatchPose * _previousPresentFrameInfo.presentPose; + // _currentFrame->prevView * glm::inverse(_prevRenderView) : this is to get the + // view matrix of the last rendered frame in the present thread + auto prevCorrection = _currentFrame->prevView * glm::inverse(_prevRenderView); + prevCorrection = prevCorrection * invPrevBatchPose * _previousPresentFrameInfo.presentPose; getGLBackend()->setCameraCorrection(correction, prevCorrection);