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:
@@ -63,7 +63,7 @@ void VolumeTechnique::traverse(osg::NodeVisitor& nv)
|
||||
{
|
||||
if (_volumeTile->getDirty()) _volumeTile->init();
|
||||
|
||||
osgUtil::UpdateVisitor* uv = dynamic_cast<osgUtil::UpdateVisitor*>(&nv);
|
||||
osgUtil::UpdateVisitor* uv = nv.asUpdateVisitor();
|
||||
if (uv)
|
||||
{
|
||||
update(uv);
|
||||
@@ -73,7 +73,7 @@ void VolumeTechnique::traverse(osg::NodeVisitor& nv)
|
||||
}
|
||||
else if (nv.getVisitorType()==osg::NodeVisitor::CULL_VISITOR)
|
||||
{
|
||||
osgUtil::CullVisitor* cv = dynamic_cast<osgUtil::CullVisitor*>(&nv);
|
||||
osgUtil::CullVisitor* cv = nv.asCullVisitor();
|
||||
if (cv)
|
||||
{
|
||||
cull(cv);
|
||||
|
||||
Reference in New Issue
Block a user