Bug 1426028 - Head rotation was being applied twice in gfxVRGVR r=kip

MozReview-Commit-ID: IzcRfzE7qxV
This commit is contained in:
Randall Barker 2017-12-18 12:43:45 -08:00
parent 8158f18570
commit 202ce39f2e
2 changed files with 4 additions and 8 deletions

View File

@ -407,7 +407,7 @@ VRDisplayGVR::GetSensorState()
result.linearVelocity[1] = 0.0f;
result.linearVelocity[2] = 0.0f;
UpdateHeadToEye(context, &rot);
UpdateHeadToEye(context);
result.CalcViewMatrices(mHeadToEyes);
return result;
@ -466,7 +466,7 @@ VRDisplayGVR::SetPresentingContext(void* aGVRPresentingContext)
}
void
VRDisplayGVR::UpdateHeadToEye(gvr_context* aContext, gfx::Quaternion* aRot)
VRDisplayGVR::UpdateHeadToEye(gvr_context* aContext)
{
if (!aContext) {
return;
@ -477,11 +477,7 @@ VRDisplayGVR::UpdateHeadToEye(gvr_context* aContext, gfx::Quaternion* aRot)
mDisplayInfo.mEyeTranslation[eyeIndex].x = -eye.m[0][3];
mDisplayInfo.mEyeTranslation[eyeIndex].y = -eye.m[1][3];
mDisplayInfo.mEyeTranslation[eyeIndex].z = -eye.m[2][3];
if (aRot) {
mHeadToEyes[eyeIndex].SetRotationFromQuaternion(*aRot);
} else {
mHeadToEyes[eyeIndex] = gfx::Matrix4x4();
}
mHeadToEyes[eyeIndex] = gfx::Matrix4x4();
mHeadToEyes[eyeIndex].PreTranslate(eye.m[0][3], eye.m[1][3], eye.m[2][3]);
}
}

View File

@ -73,7 +73,7 @@ public:
protected:
virtual ~VRDisplayGVR();
void UpdateHeadToEye(gvr_context* aContext, gfx::Quaternion* aRot = nullptr);
void UpdateHeadToEye(gvr_context* aContext);
void UpdateViewport();
void RecreateSwapChain();