Hi Robert,

Please excuse my poor explanation of the updateTraversal case. If a camera
updateCallback is used to position the slave according to a node in it's
subgraph, with the current trunk implementation you get the camera
updateCallback before the sub graph is updated, hence the values you read
from the node in the sub graph will be those of the previous
updateTraversal. I'm assuming this is an odd way of calculating the slave's
offsets and can be ignored.

Thanks for adding the changes. I have tested the lastest trunk version and
it works fine in my application.

Filip

On Tue, Nov 9, 2010 at 6:17 PM, Robert Osfield <[email protected]>wrote:

> 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
>
_______________________________________________
osg-submissions mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-submissions-openscenegraph.org

Reply via email to