Added more osg::Object::as*() methods and usage of these through the code base to avoid use of dynamic_cast<> when using UpdateVisitor/CullVisitor/EventVIisitor etc.

This commit is contained in:
Robert Osfield
2016-01-20 15:13:19 +00:00
parent 2e7cfe7efa
commit 1219a6d3bf
38 changed files with 148 additions and 60 deletions

View File

@@ -42,7 +42,7 @@ void Technique::traverse_implementation(osg::NodeVisitor& nv, Effect* fx)
}
// special actions must be taken if the node visitor is actually a CullVisitor
osgUtil::CullVisitor *cv = dynamic_cast<osgUtil::CullVisitor *>(&nv);
osgUtil::CullVisitor *cv = nv.asCullVisitor();
// traverse all passes
for (int i=0; i<getNumPasses(); ++i) {