CompositeViewer support: Difference between revisions

Jump to navigation Jump to search
m
Line 80: Line 80:
=== Views ===
=== Views ===
* The right way to remove a view is outside of frame(). Not from an event handler from within the view, this will crash as you'll be deleting the object you are doing the work from.<ref>https://www.mail-archive.com/osg-users@lists.openscenegraph.org/msg35639.html</ref>
* The right way to remove a view is outside of frame(). Not from an event handler from within the view, this will crash as you'll be deleting the object you are doing the work from.<ref>https://www.mail-archive.com/osg-users@lists.openscenegraph.org/msg35639.html</ref>
=== DatabasePager ===
* The OSG has an database paging class call osgDB::DatabasePager that is built into the osgViewer::Viewer/CompositeViewer that will automatically load databases and merge them with the main scene graph during the update traversal.  This is built around the osg::PagedLOD class, but you can also use the osg::ProxyNode.<ref>https://www.mail-archive.com/osg-users@lists.openscenegraph.org/msg68474.html</ref>
* Normally one should ever need to worry about constructing or destructing the DatabasePager, it should happen behinds the scenes managed by osgViewer.  osgViewer::Scene is used internally by osgViewer to manage one DatabasePager per scene graph.  The Scene object will be shared automatically between Views if you assign the same Node pointer then you call View::setSceneData.  This sharing is done automatically for you.  When a Scene object is destructed it's DatabasePager will be destructed if no other references to it exist. If you have multiple Views that you should be using CompositeViewer, not multiple Viewer. If you are creating and destroying views regularly then you are probably best to enable/disable them by setting the View's master Camera's NodeMask to 0x0 and back to 0xffffffff, as this will switch off rendering but keep the  backend around ready to be re-enabled.<ref>https://www.mail-archive.com/osg-users@lists.openscenegraph.org/msg63057.html</ref>
=== Threading ===
=== Threading ===
* osgViewer::CompositeViewer runs all of the views synchronously - one frame() call dispatches update, event, cull and draw traversals for all the views. <ref>https://www.mail-archive.com/osg-users@lists.openscenegraph.org/msg18308.html</ref>
* osgViewer::CompositeViewer runs all of the views synchronously - one frame() call dispatches update, event, cull and draw traversals for all the views. <ref>https://www.mail-archive.com/osg-users@lists.openscenegraph.org/msg18308.html</ref>

Navigation menu