[osg-users] NodeCallback does not traverse children

Sebastian Messerschmidt sebastian.messerschmidt at gmx.de
Mon Apr 10 01:55:19 PDT 2017



Hi Yura,
> Hi,
>
> I have created NodeCallback like in example osggeometry to update MatrixTransform of all nodes in a group.
> I applied it only for group: group.setUpdateCallback(mycallback);
> In operator() of mycallback i am calling traverse(node,nv) but it works only for group, not for it children.
> What i am doing wrong? Do I need to call setUpdateCallback for every child?

That is expected behavior. The callback is called for the element you 
added it to only. The traverse will simply tell the visitor to go on in 
its traversal so it can find nodes with an update-callback deeper  below 
your elements.
If you need to modify all childs anyways, you can run your own visitor 
from the entry of the callback.
>
> Thank you!
>
> Cheers,
> Yura
>
> ------------------
> Read this topic online here:
> http://forum.openscenegraph.org/viewtopic.php?p=70725#70725
>
>
>
>
>
> _______________________________________________
> osg-users mailing list
> osg-users at lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>



More information about the osg-users mailing list