Hi Shayne,

My question is, is adding and removing the views during runtime the way
to go or is there a more efficient/elegant way of turning my views on
and off? Is there an equivalent of a switch node for managing views in a
composite viewer?

To add/remove views at runtime you have to stop threading in the viewer, which is a pretty major disruption. Instead, you can just set the view's camera's node mask to 0.

  view->getCamera()->setNodeMask(0)

This means the camera won't be traversed and thus it won't draw anything, which is what you want. When you want to re-enable the view, set its node mask to 0xFFFFFFFF.

  view->getCamera()->setNodeMask(0xFFFFFFFF)

Hope this helps,

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