[osg-users] Only intersecting certain nodes in the scene graph

Paul Martz pmartz at skew-matrix.com
Thu Jul 3 10:27:30 PDT 2008


The traversal mask gets bitwise ANDed with the node mask. You don't say what
your node mask is set to for your text and lines, but if you AND their node
mask with your traversal mask and you get non-zero, then they will be
intersection-tested. The default node mask is 0xffffffff; perhaps you forgot
to change it for the text and lines?
 
What you probably want to do is have terrain nodes with node mask (0x1<<0),
text with (0x1<<1), lines with (0x1<<2), etc. This way, your traversal mask
of (0x1<<0), when ANDed with the node mask, will result in non-zero only for
terrain nodes.
 
Paul Martz
Skew Matrix Software LLC
http://www.skew-matrix.com <http://www.skew-matrix.com/> 
+1 303 859 9466


  _____  

From: osg-users-bounces at lists.openscenegraph.org
[mailto:osg-users-bounces at lists.openscenegraph.org] On Behalf Of Jason
Beverage
Sent: Thursday, July 03, 2008 11:20 AM
To: osg users
Subject: [osg-users] Only intersecting certain nodes in the scene graph


Hi all,

This is probably a very basic question, but I'm having a hard time
understanding how the traversal masks work when using an
IntersectionVisitor.

I have a scene that contains an osgdem generated terrain database as well as
other nodes such as text labels, lines, etc.  In certain situations, I only
want to compute the intersections against the terrain database.

I created a node mask for the terrain, 0x1, and used setNodeMask to set it
on the root node of the terrain database.

I am using the computeIntersections function of Viewer and passed along that
traversal mask hoping that it would only intersect the paged database.
However, the computeIntersections function is computing intersections
against all of the nodes in the scene graph instead of just the paged
database.

Does this usage sound correct or am I way off base?

Thanks!

Jason 


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openscenegraph.org/pipermail/osg-users-openscenegraph.org/attachments/20080703/62e5297d/attachment-0003.htm>


More information about the osg-users mailing list