Merge pull request #14999 from amerhifi/quest-demo

case 21395: Adjust culling matrix
This commit is contained in:
Sam Gateau 2019-02-24 14:51:13 -08:00 committed by GitHub
commit ff5e9ee5d3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -121,6 +121,7 @@ QRectF OculusMobileDisplayPlugin::getPlayAreaRect() {
glm::mat4 OculusMobileDisplayPlugin::getEyeProjection(Eye eye, const glm::mat4& baseProjection) const {
glm::mat4 result = baseProjection;
VrHandler::withOvrMobile([&](ovrMobile* session){
auto trackingState = vrapi_GetPredictedTracking2(session, 0.0);
result = ovr::Fov{ trackingState.Eye[eye].ProjectionMatrix }.withZ(baseProjection);
@ -136,9 +137,12 @@ glm::mat4 OculusMobileDisplayPlugin::getCullingProjection(const glm::mat4& baseP
for (size_t i = 0; i < 2; ++i) {
fovs[i].extract(trackingState.Eye[i].ProjectionMatrix);
}
fovs[0].extend(fovs[1]);
return fovs[0].withZ(baseProjection);
result= glm::scale( fovs[0].withZ(baseProjection),glm::vec3(1.5f));
return result;
});
return result;
}