Protect against divide-by-zero in setCameraParameters
Found by Csaba Halász
This commit is contained in:
parent
1a05695ff5
commit
2b0ffae339
1 changed files with 5 additions and 3 deletions
|
@ -219,9 +219,11 @@ void CameraGroup::update(const osg::Vec3d& position,
|
||||||
|
|
||||||
void CameraGroup::setCameraParameters(float vfov, float aspectRatio)
|
void CameraGroup::setCameraParameters(float vfov, float aspectRatio)
|
||||||
{
|
{
|
||||||
_viewer->getCamera()->setProjectionMatrixAsPerspective(vfov,
|
if (vfov != 0.0f && aspectRatio != 0.0f)
|
||||||
1.0f / aspectRatio,
|
_viewer->getCamera()
|
||||||
_zNear, _zFar);
|
->setProjectionMatrixAsPerspective(vfov,
|
||||||
|
1.0f / aspectRatio,
|
||||||
|
_zNear, _zFar);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue