Fixed crash in handling of osg::Callback attached as Drawable update callback.
Added handling of osg::Callback as a Drawable cull callback
This commit is contained in:
parent
8af48d369c
commit
46df1fd141
@ -55,12 +55,11 @@ class OSGUTIL_EXPORT UpdateVisitor : public osg::NodeVisitor
|
||||
{
|
||||
osg::Drawable::UpdateCallback* drawable_callback = dynamic_cast<osg::Drawable::UpdateCallback*>(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 (node_callback) (*node_callback)(&drawable, this);
|
||||
|
||||
if ((!drawable_callback && !node_callback) || callback_object) callback_object->run(&drawable, this);
|
||||
if (!drawable_callback && !node_callback) callback->run(&drawable, this);
|
||||
}
|
||||
|
||||
handle_callbacks(drawable.getStateSet());
|
||||
|
@ -990,6 +990,10 @@ void CullVisitor::apply(osg::Drawable& drawable)
|
||||
{
|
||||
if( dcb->cull( this, &drawable, &_renderInfo ) == true ) return;
|
||||
}
|
||||
else
|
||||
{
|
||||
drawable.getCullCallback()->run(&drawable,this);
|
||||
}
|
||||
}
|
||||
|
||||
if (drawable.isCullingActive() && isCulled(bb)) return;
|
||||
|
Loading…
Reference in New Issue
Block a user