From 48868982f1ae182e8ebd4697c9dbdd38e756ae86 Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Sat, 22 Mar 2003 09:48:43 +0000 Subject: [PATCH] Added a traverseGeode method to the UpdateVisitor which contains the traversal code for both the nodes traversal and the drawables the geode contains. --- include/osgUtil/UpdateVisitor | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) 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)); + } + } };