Fixed handling of Drawable callbacks and NumChildrenRequiringEventTraversal

git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/trunk@14248 16af8721-9629-0410-8352-f15c8da7e697
This commit is contained in:
Robert Osfield 2014-06-09 13:46:44 +00:00
parent a316c30b4a
commit d234262585

View File

@ -75,11 +75,11 @@ class OSGGA_EXPORT EventVisitor : public osg::NodeVisitor
osg::Callback* callback = drawable.getEventCallback();
if (callback)
{
osg::Drawable::UpdateCallback* drawable_callback = dynamic_cast<osg::Drawable::UpdateCallback*>(callback);
osg::Drawable::EventCallback* drawable_callback = dynamic_cast<osg::Drawable::EventCallback*>(callback);
osg::NodeCallback* node_callback = dynamic_cast<osg::NodeCallback*>(callback);
osg::CallbackObject* callback_object = dynamic_cast<osg::CallbackObject*>(callback);
if (drawable_callback) drawable_callback->update(this,&drawable);
if (drawable_callback) drawable_callback->event(this,&drawable);
if (node_callback) (*node_callback)(&drawable, this);
if ((!drawable_callback && !node_callback) || callback_object) callback_object->run(&drawable, this);
@ -120,7 +120,7 @@ class OSGGA_EXPORT EventVisitor : public osg::NodeVisitor
osg::Callback* callback = node.getEventCallback();
if (callback) callback->run(&node,this);
else if (node.getNumChildrenRequiringUpdateTraversal()>0) traverse(node);
else if (node.getNumChildrenRequiringEventTraversal()>0) traverse(node);
}