Refactored Callback system in osg::Node, osg::Drawable, osg::StateSet and osg::StateAttribute to use a new osg::Callback base class.

git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/trunk@14244 16af8721-9629-0410-8352-f15c8da7e697
This commit is contained in:
Robert Osfield
2014-06-05 16:26:13 +00:00
parent 35d6cb812f
commit 977ec20751
64 changed files with 590 additions and 471 deletions

View File

@@ -985,8 +985,11 @@ void CullVisitor::apply(osg::Drawable& drawable)
if( drawable.getCullCallback() )
{
if( drawable.getCullCallback()->cull( this, &drawable, &_renderInfo ) == true )
return;
osg::Drawable::CullCallback* dcb = dynamic_cast<osg::Drawable::CullCallback*>(drawable.getCullCallback());
if (dcb)
{
if( dcb->cull( this, &drawable, &_renderInfo ) == true ) return;
}
}
if (!getNodePath().empty() && getNodePath().back()->isCullingActive() && isCulled(bb)) return;
@@ -1073,7 +1076,8 @@ void CullVisitor::apply(Billboard& node)
if( drawable->getCullCallback() )
{
if( drawable->getCullCallback()->cull( this, drawable, &_renderInfo ) == true )
osg::Drawable::CullCallback* dcb = dynamic_cast<osg::Drawable::CullCallback*>(drawable->getCullCallback());
if (dcb && dcb->cull( this, drawable, &_renderInfo ) == true )
continue;
}

View File

@@ -903,8 +903,8 @@ bool SceneView::cullStage(const osg::Matrixd& projection,const osg::Matrixd& mod
// If the camera has a cullCallback execute the callback which has the
// requirement that it must traverse the camera's children.
{
osg::NodeCallback* callback = _camera->getCullCallback();
if (callback) (*callback)(_camera.get(), cullVisitor);
osg::Callback* callback = _camera->getCullCallback();
if (callback) callback->run(_camera.get(), cullVisitor);
else cullVisitor->traverse(*_camera);
}