Cleaned up the cloning usage

This commit is contained in:
Robert Osfield
2016-06-02 13:51:46 +01:00
parent 2b3ecb4af8
commit 26e489f17d

View File

@@ -720,12 +720,12 @@ void SceneView::cull()
{
if (!_cullVisitorLeft.valid()) _cullVisitorLeft = _cullVisitor->clone();
if (!_stateGraphLeft.valid()) _stateGraphLeft = dynamic_cast<StateGraph*>(_stateGraph->cloneType());
if (!_renderStageLeft.valid()) _renderStageLeft = dynamic_cast<RenderStage*>(_renderStage->clone(osg::CopyOp::DEEP_COPY_ALL));
if (!_stateGraphLeft.valid()) _stateGraphLeft = _stateGraph->cloneType();
if (!_renderStageLeft.valid()) _renderStageLeft = osg::clone(_renderStage.get(), osg::CopyOp::DEEP_COPY_ALL);
if (!_cullVisitorRight.valid()) _cullVisitorRight = _cullVisitor->clone();
if (!_stateGraphRight.valid()) _stateGraphRight = dynamic_cast<StateGraph*>(_stateGraph->cloneType());
if (!_renderStageRight.valid()) _renderStageRight = dynamic_cast<RenderStage*>(_renderStage->clone(osg::CopyOp::DEEP_COPY_ALL));
if (!_stateGraphRight.valid()) _stateGraphRight = _stateGraph->cloneType();
if (!_renderStageRight.valid()) _renderStageRight = osg::clone(_renderStage.get(), osg::CopyOp::DEEP_COPY_ALL);
_cullVisitorLeft->setDatabaseRequestHandler(_cullVisitor->getDatabaseRequestHandler());
_cullVisitorLeft->setClampProjectionMatrixCallback(_cullVisitor->getClampProjectionMatrixCallback());