Hi Tim,

On Tue, Nov 10, 2009 at 5:23 PM, Tim Moore <[email protected]> wrote:
> If you want to customize culling for a node that is a subclass of osg::Geode,
> you pretty much need to write your own cull visitor and override
> CullVisitor::apply(Geode&); the low-level code that puts geometry
> into the render graph is contained in that function and is called after
> the traverse() function of the node class.

osg::Geode is presently a bit of special case as it's the leaf node,
all is not lost, you still have different techniques that can help
avoid needing to subclassing CullVisitor.

First up, the osg::Drawable have their own cull callback so if you
want to change the culling on a Geode's drawables then you can place
the cull callback on them.

Another approach you can take is to subclass from osg::Node and mirror
the osg::Geode behavour of managing it's own Drawables, and then in a
custom traverse method you do the culling as your desire and adding
the Drawables into the CullVisitor directly.

Both of these approaches have the advantage that they work on any
viewer, and you don't have to grapple with the overriding the default
CullVisitor.

Robert.
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to