Forum Discussion
c3
11 years agoHonored Guest
Retrieving the predicted eye position at a given time?
ovrHmd_GetTrackingState() allows one to retrieve the predicted head position at a given timestamp (via HeadPose.ThePose). ovrHmd_GetEyePose() provides predicted eye positions at the predicted frame render time. I'm trying to work out the equivalent of ovrHmd_GetTrackingState() for eye positions.
Tracing back from ovrHmd_GetEyePose() through the LibOVR source leads to this function in CAPI_FrameTimeManager.cpp:
Why does FrameTimeManager::GetEyePredictionPose() return a head pose instead of an eye pose? It looks like the HeadPose field of the struct returned by ovrHmd_GetTrackingState() is not a head pose at all, but either the left or the right eye pose depending on the supplied timestamp. But that... doesn't seem right to me, especially as FrameTimeManager::GetEyePredictionTime ignores the eye parameter if VSync is disabled:
What am I missing?
Tracing back from ovrHmd_GetEyePose() through the LibOVR source leads to this function in CAPI_FrameTimeManager.cpp:
Posef FrameTimeManager::GetEyePredictionPose(ovrHmd hmd, ovrEyeType eye)
{
double eyeRenderTime = GetEyePredictionTime(eye);
ovrTrackingState eyeState = ovrHmd_GetTrackingState(hmd, eyeRenderTime);
// Record view pose sampling time for Latency reporting.
if (RenderIMUTimeSeconds == 0.0)
{
// TODO: Figure out why this are not as accurate as ovr_GetTimeInSeconds()
//RenderIMUTimeSeconds = eyeState.RawSensorData.TimeInSeconds;
RenderIMUTimeSeconds = ovr_GetTimeInSeconds();
}
return eyeState.HeadPose.ThePose;
}
Why does FrameTimeManager::GetEyePredictionPose() return a head pose instead of an eye pose? It looks like the HeadPose field of the struct returned by ovrHmd_GetTrackingState() is not a head pose at all, but either the left or the right eye pose depending on the supplied timestamp. But that... doesn't seem right to me, especially as FrameTimeManager::GetEyePredictionTime ignores the eye parameter if VSync is disabled:
double FrameTimeManager::GetEyePredictionTime(ovrEyeType eye)
{
if (VsyncEnabled)
{
return FrameTiming.EyeRenderTimes[eye];
}
// No VSync: Best guess for the near future
return ovr_GetTimeInSeconds() + ScreenSwitchingDelay + NoVSyncToScanoutDelay;
}
What am I missing?
No RepliesBe the first to reply
Quick Links
- Horizon Developer Support
- Quest User Forums
- Troubleshooting Forum for problems with a game or app
- Quest Support for problems with your device