Hi J-S,

Viewer::updateTraversal() and CompositeViewer::updateTraversal() both
traverse the scene graph and explictly camera's update callbacks.

What these updateTraversal() methods do is switch of the traversal of
the camera's subgraph when the camera subgraphs are traversed, so the
children won't be traversed.  This is done so that the scene graphs
aren't traversed multiple times per frame, but... I believe in your
case were the Camera has the subgraph attached that isn't attached as
a View's scene, won't get called.

To make sure subgraphs of Camera's that aren't part of the any View's
scene graph get traversed we'll need to make the camera update
callback calling code in *::updateTraversal() a little more
intelligent.  Perhaps a set of scene graphs that have been traversed
on each frame, or perhaps even just checking to see if a Camera has a
View associated with it would be enough to determine if the subgraph
should be traversed or not.

Does any of this make sense in the context of what you are seeing?
Robert.


On Tue, Dec 15, 2009 at 7:10 PM, Jean-Sébastien Guay
<[email protected]> wrote:
> Hi Robert,
>
>> As Paul suggests CullVisitor::apply(osg::Camera&) handles in scene
>> graph camera's, so will not handle the viewer level scene graph
>> correctly so _camera->accept(*cullVisitor) won't behave correctly.
>>
>> Perhaps you could try replacing the for loop with
>> _camera->traverse(*cullVisitor) as this will call the cull callback
>> and avoid the CullVisitor::applyOsg::Camera&) method.   If this works
>> fine let me know as I can make this change to SceneView.cpp.
>
> I had a similar question about update callbacks. Reading the code (can't
> recall where, but I suspect it's in SceneView.cpp as well) the update
> visitor is being passed to the Scene objects, and not to the cameras. The
> effect of this is that update callbacks on cameras are not called, and more
> importantly, update callbacks on nodes that are children of the camera but
> not part of the view's SceneData will not be called either.
>
> We frequently add nodes directly under a camera (instead of under a scene
> root that's the scene data of a given view) so that the nodes are only
> visible to that camera. But with the present behavior, update callbacks on
> those nodes are never called.
>
> If, instead of passing the update visitor to the scene data's root, we
> passed it to the camera's children, then we're sure all visible nodes would
> be visited, even those in the scene data...
>
> Thanks,
>
> 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
>
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to