Fixed crash and double call bug in handle event callbacks attached to Drawable

This commit is contained in:
Robert Osfield
2016-10-06 18:27:23 +01:00
parent 96b180ddad
commit 8de4c76582
3 changed files with 27 additions and 8 deletions

View File

@@ -49,10 +49,13 @@ public:
virtual DrawableEventCallback* asDrawableEventCallback() { return osg::DrawableEventCallback::asDrawableEventCallback(); }
virtual const DrawableEventCallback* asDrawableEventCallback() const { return osg::DrawableEventCallback::asDrawableEventCallback(); }
virtual EventHandler* asEventHandler() { return this; }
virtual const EventHandler* asEventHandler() const { return this; }
virtual bool run(osg::Object* object, osg::Object* data)
{
osg::Node* node = dynamic_cast<osg::Node*>(object);
osg::NodeVisitor* nv = dynamic_cast<osg::NodeVisitor*>(data);
osg::Node* node = object->asNode();
osg::NodeVisitor* nv = data->asNodeVisitor();
operator()(node, nv);
return true;
}