Moved setFusionDistance() into View::updateSceneView()

This commit is contained in:
Robert Osfield 2018-01-10 16:55:02 +00:00
parent 0eacd8161a
commit 6bd2d9054e

View File

@ -543,6 +543,12 @@ void Renderer::updateSceneView(osgUtil::SceneView* sceneView)
(*sceneView->getFrameStamp()) = *(state->getFrameStamp());
}
if (view)
{
sceneView->setFusionDistance(view->getFusionDistanceMode(), view->getFusionDistanceValue());
}
osg::DisplaySettings* ds = _camera->getDisplaySettings() ? _camera->getDisplaySettings() :
((view &&view->getDisplaySettings()) ? view->getDisplaySettings() : osg::DisplaySettings::instance().get());
@ -643,10 +649,6 @@ void Renderer::cull()
// OSG_NOTICE<<"Culling buffer "<<_currentCull<<std::endl;
// pass on the fusion distance settings from the View to the SceneView
osgViewer::View* view = dynamic_cast<osgViewer::View*>(sceneView->getCamera()->getView());
if (view) sceneView->setFusionDistance(view->getFusionDistanceMode(), view->getFusionDistanceValue());
osg::Stats* stats = sceneView->getCamera()->getStats();
const osg::FrameStamp* fs = sceneView->getFrameStamp();
unsigned int frameNumber = fs ? fs->getFrameNumber() : 0;
@ -820,13 +822,8 @@ void Renderer::cull_draw()
compile();
}
osgViewer::View* view = dynamic_cast<osgViewer::View*>(_camera->getView());
// OSG_NOTICE<<"RenderingOperation"<<std::endl;
// pass on the fusion distance settings from the View to the SceneView
if (view) sceneView->setFusionDistance(view->getFusionDistanceMode(), view->getFusionDistanceValue());
osg::Stats* stats = sceneView->getCamera()->getStats();
osg::State* state = sceneView->getState();
const osg::FrameStamp* fs = sceneView->getFrameStamp();