Hi All osg Users I'm using a visitor to obtain all Statsets in a graph. But the visitor dose not collects all statsets, why?
Code im using is simply this: class GetStatsetsVissitor : public osg::NodeVisitor { public: GetStatsetsVissitor(){ setTraversalMode(osg::NodeVisitor::TRAVERSE_ALL_CHILDREN); }; ~GetStatsetsVissitor(){}; typedef std::set<osg::ref_ptr<osg::StateSet>> StatsetSet; StatsetSet& GetStatset(void){return m_Statsets;}; protected: void apply(osg::Node &n) { if(n.getStateSet()) { m_Statsets.insert(n.getStateSet()); } traverse(n); }; StatsetSet m_Statsets; }; Regards Ragnar _______________________________________________ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org