[osg-users] Different views hide/show different nodes shared scene graph

Robert Osfield robert.osfield at gmail.com
Thu Apr 18 00:59:14 PDT 2019

Hi Catalin,

On Thu, 18 Apr 2019 at 00:42, Catalin Flower <inbox.icf at gmail.com> wrote:
> I was looking of a solution that depends on camera. Because only the view/camera knows which object is hidden. The TraversalMask will do the trick then. I see also a CullMask, guess this is not good and it will not help with the picking issue.

The View::computeIntersections(..) method allows you to pass in the
TraversalMask to use, it's 0xffffffff by default.

> My understanding the mask is a 32 bit value, this means I can only have a maximum 32 types of nodes to be shown/hidden because an AND operation is performed?

Yes.  Typically one would have broad catagories of nodes that you want
to interact with in different ways.  If you need more than 32
categories then you'll need to use custom callback or node inserted in
the scene graph in combination to state attached to the visitor to
decide whether a subgraph should be traversed or not.


More information about the osg-users mailing list