mirror of
				https://github.com/OpenMW/openmw.git
				synced 2025-10-30 12:56:38 +00:00 
			
		
		
		
	Concerns "AttachLight", "BoneOffset" and equipment part attachment points, that are all case insensitive in vanilla MW.
		
			
				
	
	
		
			38 lines
		
	
	
	
		
			839 B
		
	
	
	
		
			C++
		
	
	
	
	
	
			
		
		
	
	
			38 lines
		
	
	
	
		
			839 B
		
	
	
	
		
			C++
		
	
	
	
	
	
| #ifndef OPENMW_COMPONENTS_SCENEUTIL_VISITOR_H
 | |
| #define OPENMW_COMPONENTS_SCENEUTIL_VISITOR_H
 | |
| 
 | |
| #include <osg/NodeVisitor>
 | |
| 
 | |
| #include <components/misc/stringops.hpp>
 | |
| 
 | |
| // Commonly used scene graph visitors
 | |
| namespace SceneUtil
 | |
| {
 | |
| 
 | |
|     class FindByNameVisitor : public osg::NodeVisitor
 | |
|     {
 | |
|     public:
 | |
|         FindByNameVisitor(const std::string& nameToFind)
 | |
|             : osg::NodeVisitor(TRAVERSE_ALL_CHILDREN)
 | |
|             , mNameToFind(nameToFind)
 | |
|             , mFoundNode(NULL)
 | |
|         {
 | |
|         }
 | |
| 
 | |
|         virtual void apply(osg::Group& group)
 | |
|         {
 | |
|             if (Misc::StringUtils::ciEqual(group.getName(), mNameToFind))
 | |
|             {
 | |
|                 mFoundNode = &group;
 | |
|                 return;
 | |
|             }
 | |
|             traverse(group);
 | |
|         }
 | |
| 
 | |
|         std::string mNameToFind;
 | |
|         osg::Group* mFoundNode;
 | |
|     };
 | |
| 
 | |
| }
 | |
| 
 | |
| #endif
 |