Fixed DrawCallback in Drawable and added CullCallback to Drawable
Cull Visitor now checks for a Drawable's CullCallback and calls it if it exists. It then prunes based on the return value (bool) of the cull callback.
This commit is contained in:
@@ -895,11 +895,18 @@ void CullVisitor::apply(Geode& node)
|
||||
Matrix* matrix = getCurrentMatrix();
|
||||
for(int i=0;i<node.getNumDrawables();++i)
|
||||
{
|
||||
|
||||
Drawable* drawable = node.getDrawable(i);
|
||||
const BoundingBox &bb =drawable->getBound();
|
||||
|
||||
if (isCulled(bb,mode)) continue;
|
||||
if( drawable->getCullCallback() )
|
||||
{
|
||||
if( drawable->getCullCallback()->cull( this, drawable ) == true )
|
||||
continue;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (isCulled(bb,mode)) continue;
|
||||
}
|
||||
|
||||
|
||||
//SandB change:
|
||||
|
||||
Reference in New Issue
Block a user