Fix view fit for perspective camera by setting height angle to 45 deg

This commit is contained in:
wmayer 2012-11-23 19:23:10 +01:00
parent 96f5e18b61
commit 3347aa91e8

View File

@ -1378,6 +1378,11 @@ void View3DInventorViewer::viewAll()
group->mode = SoSkipBoundingGroup::EXCLUDE_BBOX;
}
// Set the height angle to 45 deg
SoCamera* cam = this->getCamera();
if (cam && cam->getTypeId().isDerivedFrom(SoPerspectiveCamera::getClassTypeId()))
static_cast<SoPerspectiveCamera*>(cam)->heightAngle = (float)(M_PI / 4.0);
// call the default implementation first to make sure everything is visible
SoQtViewer::viewAll();