Hello Vladimir,
So I wrote NodeVisitor that returns a NodeList of nodes that matching a certain name. But I'm afraid such approach is far not the best (and definitely not so fast, because in depth there's a strcomp() somewhere).
Well, if your NodeVisitor runs in the frame loop of course it's probably not best way... The solution might be to only run the visitor at startup (when loading the terrain), and save the list of node pointers it returns for later. This will work fine if your terrain doesn't change. If there's a possibility that your terrain changes, then you can always run the visitor only when the terrain changes, so (if the visitor is really slow) you might get a frame hit at that time but after that it will be fine.
In any case, apart from these ideas on how to do things better, for any performance concern like this one, the general guidelines apply: 1. Profile the code and see if it's using up a significant amount of time. If not, then don't waste time optimizing it.
2. If you get a solid 60Hz, it's not worth wasting time optimizing this. Hope this helps, J-S -- ______________________________________________________ Jean-Sebastien Guay [email protected] http://www.cm-labs.com/ http://whitestar02.webhop.org/ _______________________________________________ osg-users mailing list [email protected] http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

