Hi Robert,
I have a situation in which I want to set the userdata of a scenegraph
node to be another node, specifically one of its (indirect) parents. E.g.
MyMatrixTransform (subclass of MatrixTransform)
child #1: Geode
drawable #1: some geometry, user data = MyMatrixTransform instance
child #2: Geode
.....
The reason for this is to simplify picking handling. The idea is that
when processing the list of intersected drawables during picking only
those drawables that have any userdata associated with them need to be
processed. The userdata pointer in that case immediately provides the
parent transform object (which holds application specific data), without
having to go through the list of parents until the transform is reached.
However, this doesn't work because at runtime calls to
setThreadSafeRefUnref() are made by OSG and this results in infinite
recursion as Drawable::setThreadSafeRefUnref() calls
_userData->setThreadSafeRefUnref(), and that takes it back up the scene
graph, after which the transform's children are once again called with
setThreadSafeRefUnref(), etc.
I'm having trouble locating the first call that starts it all. Is there
a way to avoid these calls?
Regards,
Paul
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org