Skip to content
This repository was archived by the owner on Jul 22, 2024. It is now read-only.

Commit 79c5a6a

Browse files
MortimerGorobluemarvin
authored andcommitted
Set ExternalVR timestamp (#928)
1 parent f198c0d commit 79c5a6a

File tree

3 files changed

+5
-3
lines changed

3 files changed

+5
-3
lines changed

app/src/main/cpp/BrowserWorld.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -1038,7 +1038,7 @@ BrowserWorld::DrawImmersive() {
10381038

10391039
m.device->StartFrame();
10401040
VRB_GL_CHECK(glDepthMask(GL_FALSE));
1041-
m.externalVR->PushFramePoses(m.device->GetHeadTransform(), m.controllers->GetControllers());
1041+
m.externalVR->PushFramePoses(m.device->GetHeadTransform(), m.controllers->GetControllers(), m.context->GetTimestamp());
10421042
int32_t surfaceHandle = 0;
10431043
device::EyeRect leftEye, rightEye;
10441044
bool aDiscardFrame = !m.externalVR->WaitFrameResult();

app/src/main/cpp/ExternalVR.cpp

+3-1
Original file line numberDiff line numberDiff line change
@@ -372,7 +372,7 @@ ExternalVR::GetVRState() const {
372372
}
373373

374374
void
375-
ExternalVR::PushFramePoses(const vrb::Matrix& aHeadTransform, const std::vector<Controller>& aControllers) {
375+
ExternalVR::PushFramePoses(const vrb::Matrix& aHeadTransform, const std::vector<Controller>& aControllers, const double aTimestamp) {
376376
const vrb::Matrix inverseHeadTransform = aHeadTransform.Inverse();
377377
vrb::Quaternion quaternion(inverseHeadTransform);
378378
vrb::Vector translation = aHeadTransform.GetTranslation();
@@ -429,6 +429,8 @@ ExternalVR::PushFramePoses(const vrb::Matrix& aHeadTransform, const std::vector<
429429
}
430430
}
431431

432+
m.system.sensorState.timestamp = aTimestamp;
433+
432434
PushSystemState();
433435
}
434436

app/src/main/cpp/ExternalVR.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ class ExternalVR : public ImmersiveDisplay {
5151
void SetCompositorEnabled(bool aEnabled);
5252
bool IsPresenting() const;
5353
VRState GetVRState() const;
54-
void PushFramePoses(const vrb::Matrix& aHeadTransform, const std::vector<Controller>& aControllers);
54+
void PushFramePoses(const vrb::Matrix& aHeadTransform, const std::vector<Controller>& aControllers, const double aTimestamp);
5555
bool WaitFrameResult();
5656
void GetFrameResult(int32_t& aSurfaceHandle, device::EyeRect& aLeftEye, device::EyeRect& aRightEye) const;
5757
void StopPresenting();

0 commit comments

Comments
 (0)