From 26e489f17d87666c7038eafb92c85677400a9cca Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Thu, 2 Jun 2016 13:51:46 +0100 Subject: [PATCH] Cleaned up the cloning usage --- src/osgUtil/SceneView.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/osgUtil/SceneView.cpp b/src/osgUtil/SceneView.cpp index e08783a2e..1550f49c8 100644 --- a/src/osgUtil/SceneView.cpp +++ b/src/osgUtil/SceneView.cpp @@ -720,12 +720,12 @@ void SceneView::cull() { if (!_cullVisitorLeft.valid()) _cullVisitorLeft = _cullVisitor->clone(); - if (!_stateGraphLeft.valid()) _stateGraphLeft = dynamic_cast(_stateGraph->cloneType()); - if (!_renderStageLeft.valid()) _renderStageLeft = dynamic_cast(_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->cloneType()); - if (!_renderStageRight.valid()) _renderStageRight = dynamic_cast(_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());