mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-08-10 03:13:18 +02:00
Merge pull request #14999 from amerhifi/quest-demo
case 21395: Adjust culling matrix
This commit is contained in:
commit
ff5e9ee5d3
1 changed files with 5 additions and 1 deletions
|
@ -121,6 +121,7 @@ QRectF OculusMobileDisplayPlugin::getPlayAreaRect() {
|
||||||
|
|
||||||
glm::mat4 OculusMobileDisplayPlugin::getEyeProjection(Eye eye, const glm::mat4& baseProjection) const {
|
glm::mat4 OculusMobileDisplayPlugin::getEyeProjection(Eye eye, const glm::mat4& baseProjection) const {
|
||||||
glm::mat4 result = baseProjection;
|
glm::mat4 result = baseProjection;
|
||||||
|
|
||||||
VrHandler::withOvrMobile([&](ovrMobile* session){
|
VrHandler::withOvrMobile([&](ovrMobile* session){
|
||||||
auto trackingState = vrapi_GetPredictedTracking2(session, 0.0);
|
auto trackingState = vrapi_GetPredictedTracking2(session, 0.0);
|
||||||
result = ovr::Fov{ trackingState.Eye[eye].ProjectionMatrix }.withZ(baseProjection);
|
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) {
|
for (size_t i = 0; i < 2; ++i) {
|
||||||
fovs[i].extract(trackingState.Eye[i].ProjectionMatrix);
|
fovs[i].extract(trackingState.Eye[i].ProjectionMatrix);
|
||||||
}
|
}
|
||||||
|
|
||||||
fovs[0].extend(fovs[1]);
|
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;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue