vrecko
virtual reality framework
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
grass.h
Go to the documentation of this file.
1 #ifndef _GRASS_GRASS_H
2 #define _GRASS_GRASS_H
3 
4 #include "grass_cullcallback.h"
5 #include "grass_parameters.h"
6 #include "grass_drawable.h"
7 
8 #include <vrecko/Ability.h>
9 //#include <osg/TriangleFunctor>
11 //#include <osg/Vec3>
12 
13 #include <gl/gl.h>
14 
15 using namespace vrecko;
16 using namespace osg;
17 
18 namespace grass
19 {
20 
21 
22 
23  // Ability which covers nearly any object with grass-like coat.
24  class Grass : public vrecko::Ability
25  {
26  protected:
27  // create a grass-like mesh for all geometry in given Group
28  void CoatWithGrass(Group * pGroup);
29 
30  // creates a grass Geometry for given Geode
31  //GrassDrawable * CreateGrassGeometry(const Geode * pGeode);
32 
33  // holds all parameters of this ability
34  ref_ptr<GrassAbilityParameters> params;
35  public:
36  Grass() : Ability("Grass") {params = new GrassAbilityParameters;}
37 
38  virtual ~Grass() {}
39  void update(void) {}
40  void postInitialize(void);
41 // std::string getAcceptableMessages(void) {return std::string("");}
42 // vrecko::Message *getMessage(void) {return NULL;}
43 
44  // for loading of parameters, we can use method LoadParameters of structure GrassAbilityParameters
45  bool loadXMLParameters(XERCES_CPP_NAMESPACE_QUALIFIER DOMNode *parametersNode)
46  { return params->loadXMLParameters(parametersNode); }
47 
48  // for saving parameters, we can use appropriate method of struct GrassAbilityParameters
49  XERCES_CPP_NAMESPACE_QUALIFIER DOMNode *saveXMLParameters(XERCES_CPP_NAMESPACE_QUALIFIER DOMDocument * d)
50  { return params->saveXMLParameters(d); }
51  };
52 
53 
54 
55 
56 }; // end of namespace grass
57 
58 #endif // _GRASS_GRASS_H