Hi Filip,
What I've gone for, is calling camera->accept() when handling slaves
with their subgraphs, and then amending the update callback code path
for cases where the slave shares the subgraph with the master.
Extract of what I've done in Viewer.cpp below.
Changes now checked into svn/trunk. Could you please check out
svn/trunk and let me know if things are working fine for you
application.
Cheers,
Robert.
{
// Do UpdateTraversal for slaves with their own subgraph
for(unsigned int i=0; i<getNumSlaves(); ++i)
{
osg::View::Slave& slave = getSlave(i);
osg::Camera* camera = slave._camera.get();
if(camera && !slave._useMastersSceneData)
{
camera->accept(*_updateVisitor);
}
}
}
{
// call any camera update callbacks, but only traverse that
callback, don't traverse its subgraph
// leave that to the scene update traversal.
osg::NodeVisitor::TraversalMode tm = _updateVisitor->getTraversalMode();
_updateVisitor->setTraversalMode(osg::NodeVisitor::TRAVERSE_NONE);
if (_camera.valid() && _camera->getUpdateCallback())
_camera->accept(*_updateVisitor);
for(unsigned int i=0; i<getNumSlaves(); ++i)
{
osg::View::Slave& slave = getSlave(i);
osg::Camera* camera = slave._camera.get();
if (camera && slave._useMastersSceneData &&
camera->getUpdateCallback())
{
camera->accept(*_updateVisitor);
}
}
_updateVisitor->setTraversalMode(tm);
}
_______________________________________________
osg-submissions mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-submissions-openscenegraph.org