Hi,
Well, if your goal is like mine, I have "a" solution but it is not the best & I
don't know a better one as of right now:
1. set up a data struct that holds your objects and info to update the object
of in the object list
my list is very detailed as there are other things I track besides the
position of an object and it's orientation: light on/off, fog on/off, label
on/off, etc...
2. I also hold a "copy" of the object's "PAX" positionAttitudeTransform w/in my
object list so that I may look it up quickly w/in OSG's node tree to update it
when I need to.
3. Implement a locking mechanism to LOCK the OSG node tree each time you wish
to update a node w/in the tree
Why? Because I found that updating a node or PAX as I call it outside of
the rendering loop causes a crash because while I'm accessing my PAX OSG's
render loop can also access that very same node & a crash occurs
4. When I insert or update a node into the node scene, I lock the OSG node
tree, perform my insert/update, and then unlock the node tree.
This is not the best way, but it is the only way I know of at this time that
allows me to updated nodes in a real-time/semi-real-time simulation environment.
However, constantly locking & unlocking the node tree does slow the system down
and I do believe that there is a better way.
Cheers,
Allen
------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=25721#25721
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org