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

Jason Beverage jasonbeverage at gmail.com
Thu Jul 3 12:11:08 PDT 2008


Hi all,

Thanks again for the tips, everything is working great now!

Jason

On Thu, Jul 3, 2008 at 1:46 PM, Jason Beverage <jasonbeverage at gmail.com>
wrote:

> Hi everyone,
>
> 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
> thought.
>
> Thanks!
>
> Jason
>
>
> 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
>>> database.
>>>
>>
>> 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,
>>
>> J-S
>> --
>> ______________________________________________________
>> Jean-Sebastien Guay    jean-sebastien.guay at cm-labs.com
>>                               http://www.cm-labs.com/
>>                        http://whitestar02.webhop.org/
>>
>> _______________________________________________
>> osg-users mailing list
>> osg-users at lists.openscenegraph.org
>> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openscenegraph.org/pipermail/osg-users-openscenegraph.org/attachments/20080703/ede5ea4e/attachment-0003.htm>


More information about the osg-users mailing list