DI-Guy SDK Documentation  13.1
diguyOsgGraphicsShape.h
Go to the documentation of this file.
1 #ifndef diguyOsgGraphicsShape_h__
2 #define diguyOsgGraphicsShape_h__
3 
4 
5 /*****************************************************************************
6  **
7  *2 diguyOsgGraphicsShape
8  **
9  */
10 
11 #include <diguyGraphicsShape.h>
12 
13 #include <osg/Switch>
14 #include <osg/LOD>
15 #include <osg/Geode>
16 
17 
18 /*****************************************************************************
19  **
20  ** Class declaration. diguyOsgGraphicsShape publicly inherits
21  ** diguyGraphicsShape. Virtual functions are declared for some of the
22  ** virtual functions in the base class.
23  */
25 {
26 
27 public:
28 
29  diguyOsgGraphicsShape(void* internal_data);
30 
31  virtual void build();
32  virtual void unbuild();
33  virtual void show();
34  virtual void hide();
35 
36  virtual void instancing_state_changed(int val);
37 
38  virtual void set_graphics_lod_ranges(float* lod_ranges);
39  virtual void set_graphics_lod(int lod);
40 
41  static void set_use_pixel_lods(bool use_pixel_lods) {s_use_pixel_lods = use_pixel_lods;}
42 
43  /*
44  * Overrides the base class and gives an opportunity to feed per shape
45  * matrix data to shader.
46  */
47  virtual void update();
48 
49  /*
50  * String to use for the uniform array of bones.
51  */
53  static char* s_ufrm_link_colors_string;
54 
55  std::vector<osg::Geode*> m_geodes;
56 
57 protected:
58 
59  osg::ref_ptr<osg::Switch> m_switch_node;
60 
61  /*
62  * One and only one of m_lod_node and m_manual_lod_switch_node
63  * should be non-NULL.
64  */
65  osg::ref_ptr<osg::LOD> m_lod_node;
66 
67  static bool s_use_pixel_lods;
68  osg::ref_ptr<osg::Uniform> m_ufrm_link_matrices;
69  osg::ref_ptr<osg::Uniform> m_ufrm_link_colors;
70 
71 };
72 
73 
79 
80 #endif // diguyOsgGraphicsShape_h__
virtual void unbuild()
This function will be called by DI-Guy when it is time for the renderer-specific shape objects create...
Definition: diguyOsgGraphicsShape.cpp:392
static char * s_ufrm_link_colors_string
Definition: diguyOsgGraphicsShape.h:52
virtual void show()
This function will be called by DI-Guy when the shape should be shown, typically due to a change in t...
Definition: diguyOsgGraphicsShape.cpp:463
diguyOsgGraphicsShape(void *internal_data)
Definition: diguyOsgGraphicsShape.cpp:70
diguyGraphicsShape * diguyOsgGraphicsShape_create_func(void *internal_data)
Create function declaration.
Definition: diguyOsgGraphicsShape.cpp:665
virtual void build()
This function will be called by DI-Guy when it is time for renderer-specific shape objects to be crea...
Definition: diguyOsgGraphicsShape.cpp:100
static void set_use_pixel_lods(bool use_pixel_lods)
Definition: diguyOsgGraphicsShape.h:40
virtual void hide()
This function will be called by DI-Guy when the shape should be hidden, typically due to a change in ...
Definition: diguyOsgGraphicsShape.cpp:487
Definition: diguyOsgGraphicsShape.h:23
virtual void set_graphics_lod(int lod)
This function will be called by DI-Guy when the LOD of this link is "manually" set by a diguyCharacte...
Definition: diguyOsgGraphicsShape.cpp:649
static char * s_ufrm_link_matrices_string
Definition: diguyOsgGraphicsShape.h:51
virtual void update()
This function will be called by DI-Guy when it is time for renderer-specific shape objects created du...
Definition: diguyOsgGraphicsShape.cpp:517
A class that represents the unique per-character non-shared mesh object. DI-Guy encapsulates its text...
Definition: diguyGraphicsShape.h:53
virtual void set_graphics_lod_ranges(float *lod_ranges)
This function will be called by DI-Guy when the LOD ranges of this shape need to be updated after the...
Definition: diguyOsgGraphicsShape.cpp:619
virtual void instancing_state_changed(int val)
Definition: diguyOsgGraphicsShape.cpp:499