J-S,
I tried adding an update callback to the top level camera and that did work. I checked the code and it does call accept:
346:
_camera->accept(*_updateVisitor.get());
So it should work correctly (as of 2.8.2)

-Colin


On 12/15/2009 2:10 PM, Jean-Sébastien Guay 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

--
Colin Branch
VT MAK
work: (617) 876-8085 Ext. 159
email: [email protected]

_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to