[osg-users] Only intersecting certain nodes in the scene graph
jasonbeverage at gmail.com
Thu Jul 3 10:46:12 PDT 2008
Thanks for your all your responses. The only node mask that I was modifying
was that of the terrain database and was leaving the masks for the other
items at their default of 0xffffffff.
It looks like I need to do more managed of the NodeMasks than I originally
On Thu, Jul 3, 2008 at 1:37 PM, Jean-Sébastien Guay <
jean-sebastien.guay at cm-labs.com> wrote:
> Hi Jason,
> 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
> The default node mask is 0xFFFFFFFF, and you don't mention if you set the
> node mask on your text items (or other objects) to something else. No matter
> what the traversal mask is you give to computeIntersections, it will return
> true when ANDed with 0xFFFFFFFF...
> You can for example set your terrain's mask to 0x1, and your GUI elements
> or other things to 0x2, and then give 0x1 as the traversal mask in
> computeIntersections, and it will only intersect with the terrain.
> I generally reserve one bit of the nodemask to items that are pickable, I
> find that makes comprehension simpler. Then I just have to make sure to set
> each object's nodemask appropriately at creation.
> Hope this helps,
> Jean-Sebastien Guay jean-sebastien.guay at cm-labs.com
> osg-users mailing list
> osg-users at lists.openscenegraph.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the osg-users