Craig, We've done something similar to what you want to do but in a separate process rather than a separate thread. We have done it in an asynchronous thread as well. The reason we chose to go with a process is that it allows us to run it on a remote machine away from the rendering process if need be. The process has a listening thread that receives two world positions (e.g. line of sight from ownship to target) over the network. Upon reception, it computes the intersection with a terrain database (i.e. node read into a scenegraph) and returns the closest intersection distance back over the network to the other process that made the request via a sending thread.
Bottom line is that it can be done. It basically amounts to having asynchronous traversal of the same scenegraph, one for rendering traversal and the other for intersections. These traversals can either be done in different threads or different processes. -Shayne -----Original Message----- From: osg-users-boun...@lists.openscenegraph.org [mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of Craig S. Bosma Sent: Thursday, May 12, 2011 1:14 PM To: OpenSceneGraph Users Subject: [osg-users] Intersection testing in a separate thread Hi, I have an OSG-based simulation that I'm considering retrofitting to decouple the actual simulation rate from the render frame rate. It's not viewer-based. A simplified example would be and application that listens for a network message identifying two world positions, performs and intersection test, and returns a response, while rendering/updating the scene. Currently this happens serially, but I want to put the network listener and intersection testing on a separate thread. Obviously the shared data here is (a portion of) the scenegraph, which may be modified by the render/update thread. I want the network/query thread to be able to respond as quickly as possible, and not depend on how fast the scene can be drawn, as it is currently. Does anyone have any advice/experience/examples for how to best approach this kind problem? Is it even feasible? Thanks, Craig _______________________________________________ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org