diff --git a/include/osgUtil/UpdateVisitor b/include/osgUtil/UpdateVisitor index 28f57c54c..f00b1b6cc 100644 --- a/include/osgUtil/UpdateVisitor +++ b/include/osgUtil/UpdateVisitor @@ -79,17 +79,20 @@ class OSGUTIL_EXPORT UpdateVisitor : public osg::NodeVisitor { osg::NodeCallback* callback = node.getUpdateCallback(); if (callback) (*callback)(&node,this); - else if (node.getNumChildrenRequiringUpdateTraversal()>0) traverse(node); - - // call the app callbacks on the drawables. - for(unsigned int i=0;igetUpdateCallback(); - if (callback) callback->update(this,node.getDrawable(i)); - } - + else if (node.getNumChildrenRequiringUpdateTraversal()>0) traverseGeode(node); } + inline void traverseGeode(osg::Geode& geode) + { + traverse((osg::Node&)geode); + + // call the app callbacks on the drawables. + for(unsigned int i=0;igetUpdateCallback(); + if (callback) callback->update(this,geode.getDrawable(i)); + } + } };