Added asUpdate/Cull/EventVisitor and asCamera/asDrawable to osg::Object and usage of these within the code base to avoid dynamic_cast<> usage.

This commit is contained in:
Robert Osfield
2016-01-20 17:49:10 +00:00
parent 2e7cfe7efa
commit 8fc287c1b7
37 changed files with 118 additions and 63 deletions

View File

@@ -719,11 +719,11 @@ void SceneView::cull()
else
{
if (!_cullVisitorLeft.valid()) _cullVisitorLeft = dynamic_cast<CullVisitor*>(_cullVisitor->clone());
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 (!_cullVisitorRight.valid()) _cullVisitorRight = dynamic_cast<CullVisitor*>(_cullVisitor->clone());
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));