Skip to content

Commit

Permalink
Merge branch 'gz-rendering8' into athenaz/simple_demo_qml_gamma
Browse files Browse the repository at this point in the history
  • Loading branch information
athenaz2 authored Jul 24, 2024
2 parents 661ac4e + 3335d59 commit 4ecb579
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
6 changes: 5 additions & 1 deletion ogre/src/OgreWideAngleCamera.cc
Original file line number Diff line number Diff line change
Expand Up @@ -452,7 +452,11 @@ void OgreWideAngleCamera::CreateWideAngleTexture()

double vfov = 2.0 * atan(tan(this->HFOV().Radian() / 2.0) / ratio);
this->dataPtr->ogreCamera->setAspectRatio(ratio);
this->dataPtr->ogreCamera->setFOVy(Ogre::Radian(vfov));
// Setting the fov is likely not necessary for the ogreCamera but
// clamp to max fov supported by ogre to avoid issues with building the
// frustum
this->dataPtr->ogreCamera->setFOVy(Ogre::Radian(
Ogre::Real(std::clamp(vfov, 0.0, GZ_PI))));

// create the env cameras and textures
this->CreateEnvCameras();
Expand Down
7 changes: 6 additions & 1 deletion ogre2/src/Ogre2WideAngleCamera.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1344,7 +1344,12 @@ void Ogre2WideAngleCamera::PrepareForFinalPass(Ogre::Pass *_pass)
const double ratio = static_cast<double>(this->ImageWidth()) /
static_cast<double>(this->ImageHeight());
const double vfov = 2.0 * atan(tan(this->HFOV().Radian() / 2.0) / ratio);
this->dataPtr->ogreCamera->setFOVy(Ogre::Radian(Ogre::Real(vfov)));

// Setting the fov is likely not necessary in the final pass but
// clamp to max fov supported by ogre to avoid issues with building the
// frustum
this->dataPtr->ogreCamera->setFOVy(Ogre::Radian(
Ogre::Real(std::clamp(vfov, 0.0, GZ_PI))));

const float localHfov = static_cast<float>(this->HFOV().Radian());

Expand Down

0 comments on commit 4ecb579

Please sign in to comment.