Using a Traverser is very simple. While it is a four-step process, one process might be a one-time operation and two processes are optional:
SearchTraverser cst;
cst
to look for all Nodes of type LightSource, do the following: cst.setBaseClassSearch( true ); cst.setClassName("class nvsg::LightSource");
apply
of the Traverser. Depending on the type of Traverser, it might be OK to omit the ViewState argument. cst.apply( NULL, &scene );
const vector<const Object *> & searchResults = cst.getResults();
RenderTraverser * rt = new GLTraverser; rt->apply( &viewState, &scene );