Hello Martin,

But there didn't seem to be any code inside the intersector to act on the 
traversal mask.

Again, since IntersectionVisitor is a NodeVisitor, the traversal will implicitly call NodeVisitor::traverse(node), which calls either Node::ascend(nv) or Node::traverse(nv), which for osg::Group calls Node::accept(nv) for each child, which finally checks the node mask with NodeVisitor::validNodeMask(node) before calling (the possibly overridden) NodeVisitor::apply(node).

This is what happens by default for all NodeVisitors. It's a basic principle of OSG's NodeVisitors - the visitor will respect a traversal mask which is 0xFFFFFFFF by default.

The call path is a bit complex to follow, granted (the visitor pattern, like all patterns, solves a problem by adding one or more layers of abstraction), but placing a breakpoint in osg::NodeVisitor::validNodeMask() and then checking that it was called for your intersectionVisitor would have allowed you to see that it was indeed checked.

J-S
--
______________________________________________________
Jean-Sebastien Guay    [email protected]
                               http://www.cm-labs.com/
                        http://whitestar02.webhop.org/
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to