Hi,
 
I want to save some CPU-cycles by ignoring collision-detection on some of my 
scene nodes.
Is the following code the best way to do it?
 
void MyGroup::traverse( osg::NodeVisitor& nv)
{
    switch( nv.getVisitorType() )
    {
    case osg::NodeVisitor::NODE_VISITOR:
        if( dynamic_cast<osgUtil::IntersectionVisitor*>(&nv) )
        {
            return;  // Prohibit visitor from visiting my children
        }
 
    ... other traverse code ...
 
    }
    osg::Group::traverse( nv );
}
 
The class MyGroup (public of osg::Group) is the parent of all nodes that I do 
not want intersection visitors to see.
 
Viggo
 
_________________________________________________________________
Hold kontakten med Windows Live Messenger.
http://clk.atdmt.com/GBL/go/msnnkdre0010000003gbl/direct/01/
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to