diff --git a/app/src/main/cpp/BrowserWorld.cpp b/app/src/main/cpp/BrowserWorld.cpp index 46a7c0999..41e9d5598 100644 --- a/app/src/main/cpp/BrowserWorld.cpp +++ b/app/src/main/cpp/BrowserWorld.cpp @@ -1038,7 +1038,7 @@ BrowserWorld::DrawImmersive() { m.device->StartFrame(); VRB_GL_CHECK(glDepthMask(GL_FALSE)); - m.externalVR->PushFramePoses(m.device->GetHeadTransform(), m.controllers->GetControllers()); + m.externalVR->PushFramePoses(m.device->GetHeadTransform(), m.controllers->GetControllers(), m.context->GetTimestamp()); int32_t surfaceHandle = 0; device::EyeRect leftEye, rightEye; bool aDiscardFrame = !m.externalVR->WaitFrameResult(); diff --git a/app/src/main/cpp/ExternalVR.cpp b/app/src/main/cpp/ExternalVR.cpp index 6ad15b89f..a881e771c 100644 --- a/app/src/main/cpp/ExternalVR.cpp +++ b/app/src/main/cpp/ExternalVR.cpp @@ -372,7 +372,7 @@ ExternalVR::GetVRState() const { } void -ExternalVR::PushFramePoses(const vrb::Matrix& aHeadTransform, const std::vector& aControllers) { +ExternalVR::PushFramePoses(const vrb::Matrix& aHeadTransform, const std::vector& aControllers, const double aTimestamp) { const vrb::Matrix inverseHeadTransform = aHeadTransform.Inverse(); vrb::Quaternion quaternion(inverseHeadTransform); vrb::Vector translation = aHeadTransform.GetTranslation(); @@ -429,6 +429,8 @@ ExternalVR::PushFramePoses(const vrb::Matrix& aHeadTransform, const std::vector< } } + m.system.sensorState.timestamp = aTimestamp; + PushSystemState(); } diff --git a/app/src/main/cpp/ExternalVR.h b/app/src/main/cpp/ExternalVR.h index 78a494023..5011c3d97 100644 --- a/app/src/main/cpp/ExternalVR.h +++ b/app/src/main/cpp/ExternalVR.h @@ -51,7 +51,7 @@ class ExternalVR : public ImmersiveDisplay { void SetCompositorEnabled(bool aEnabled); bool IsPresenting() const; VRState GetVRState() const; - void PushFramePoses(const vrb::Matrix& aHeadTransform, const std::vector& aControllers); + void PushFramePoses(const vrb::Matrix& aHeadTransform, const std::vector& aControllers, const double aTimestamp); bool WaitFrameResult(); void GetFrameResult(int32_t& aSurfaceHandle, device::EyeRect& aLeftEye, device::EyeRect& aRightEye) const; void StopPresenting();