mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-02-13 03:33:48 +00:00
Always use the latest eye pose data from the HMD
This commit is contained in:
parent
a83afa07ea
commit
2da474c484
2 changed files with 10 additions and 1 deletions
|
|
@ -329,6 +329,11 @@ void OpenVRRenderState::reset(vr::IVRSystem* hmd)
|
|||
if (!mHMD)
|
||||
return;
|
||||
|
||||
updateHMDProjection();
|
||||
}
|
||||
|
||||
void OpenVRRenderState::updateHMDProjection()
|
||||
{
|
||||
vr::HmdMatrix34_t mat = mHMD->GetEyeToHeadTransform(vr::Eye_Left);
|
||||
mEyePose[0] = OpenVRUtil::convertSteamVRAffineMatrixToMatrixFPlain(mat);
|
||||
mEyePose[0].inverse();
|
||||
|
|
@ -911,6 +916,9 @@ void OpenVRProvider::updateTrackedPoses()
|
|||
|
||||
compositor->WaitGetPoses(mTrackedDevicePose, vr::k_unMaxTrackedDeviceCount, NULL, 0);
|
||||
|
||||
// Make sure we're using the latest eye offset in case user has changed IPD
|
||||
mHMDRenderState.updateHMDProjection();
|
||||
|
||||
mValidPoseCount = 0;
|
||||
|
||||
for (int nDevice = 0; nDevice < vr::k_unMaxTrackedDeviceCount; ++nDevice)
|
||||
|
|
@ -924,7 +932,7 @@ void OpenVRProvider::updateTrackedPoses()
|
|||
if (nDevice == vr::k_unTrackedDeviceIndex_Hmd)
|
||||
{
|
||||
mHMDRenderState.mHMDPose = mat;
|
||||
// jaeesu - store the last rotation for temp debugging
|
||||
// jamesu - store the last rotation for temp debugging
|
||||
MatrixF torqueMat(1);
|
||||
OpenVRUtil::convertTransformFromOVR(mat, torqueMat);
|
||||
gLastMoveRot = AngAxisF(torqueMat);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue