OpenMW
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
util.hpp
Go to the documentation of this file.
1 #ifndef OPENMW_MWRENDER_UTIL_H
2 #define OPENMW_MWRENDER_UTIL_H
3 
4 #include <osg/NodeCallback>
5 #include <osg/ref_ptr>
6 #include <string>
7 
8 namespace osg
9 {
10  class Node;
11 }
12 
13 namespace Resource
14 {
15  class ResourceSystem;
16 }
17 
18 namespace MWRender
19 {
20  // Overrides the texture of nodes in the mesh that had the same NiTexturingProperty as the first NiTexturingProperty of the .NIF file's root node,
21  // if it had a NiTexturingProperty. Used for applying "particle textures" to magic effects.
22  void overrideFirstRootTexture(const std::string &texture, Resource::ResourceSystem *resourceSystem, osg::ref_ptr<osg::Node> node);
23 
24  void overrideTexture(const std::string& texture, Resource::ResourceSystem* resourceSystem, osg::ref_ptr<osg::Node> node);
25 
26  // Node callback to entirely skip the traversal.
27  class NoTraverseCallback : public osg::NodeCallback
28  {
29  public:
30  virtual void operator()(osg::Node* node, osg::NodeVisitor* nv)
31  {
32  // no traverse()
33  }
34  };
35 }
36 
37 #endif
Wrapper class that constructs and provides access to the most commonly used resource subsystems...
Definition: resourcesystem.hpp:24
Definition: util.hpp:27
virtual void operator()(osg::Node *node, osg::NodeVisitor *nv)
Definition: util.hpp:30
void overrideFirstRootTexture(const std::string &texture, Resource::ResourceSystem *resourceSystem, osg::ref_ptr< osg::Node > node)
Definition: util.cpp:39
void overrideTexture(const std::string &texture, Resource::ResourceSystem *resourceSystem, osg::ref_ptr< osg::Node > node)
Definition: util.cpp:45