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:
parent
a316c30b4a
commit
d234262585
@ -75,11 +75,11 @@ class OSGGA_EXPORT EventVisitor : public osg::NodeVisitor
|
|||||||
osg::Callback* callback = drawable.getEventCallback();
|
osg::Callback* callback = drawable.getEventCallback();
|
||||||
if (callback)
|
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::NodeCallback* node_callback = dynamic_cast<osg::NodeCallback*>(callback);
|
||||||
osg::CallbackObject* callback_object = dynamic_cast<osg::CallbackObject*>(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 (node_callback) (*node_callback)(&drawable, this);
|
||||||
|
|
||||||
if ((!drawable_callback && !node_callback) || callback_object) callback_object->run(&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();
|
osg::Callback* callback = node.getEventCallback();
|
||||||
if (callback) callback->run(&node,this);
|
if (callback) callback->run(&node,this);
|
||||||
else if (node.getNumChildrenRequiringUpdateTraversal()>0) traverse(node);
|
else if (node.getNumChildrenRequiringEventTraversal()>0) traverse(node);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user