voxelTerrain
 All Classes Functions Variables Typedefs Enumerations Pages
renderer.hpp
1 #ifndef BLUB_PROCEDURAL_VOXEL_TILE_RENDERER_HPP
2 #define BLUB_PROCEDURAL_VOXEL_TILE_RENDERER_HPP
3 
4 #include "blub/math/vector3int.hpp"
5 #include "blub/procedural/voxel/tile/base.hpp"
6 
7 
8 namespace blub
9 {
10 namespace procedural
11 {
12 namespace voxel
13 {
14 namespace tile
15 {
16 
17 
22 template <class configType>
23 class renderer : public base<renderer<configType> >
24 {
25 public:
26  typedef configType t_config;
27  typedef base<renderer<t_config> > t_base;
28  typedef typename t_config::t_renderer::t_tile* t_thiz;
29  typedef typename t_config::t_surface::t_tile t_tileData;
30  typedef blub::sharedPointer<t_tileData> t_tileDataPtr;
31 
36  {
37  ;
38  }
39 
45  void setTileData(t_tileDataPtr convertToRenderAble, const axisAlignedBox &aabb) {;}
46 
51  virtual void setVisible(const bool& vis)
52  {
53  m_shouldBeVisible = vis;
54  }
55 
61  virtual void setVisibleLod(const uint16& indLod, const bool& vis)
62  {
63  m_lodShouldBeVisible[indLod] = vis;
64  }
65 
70  const bool &getVisible() const
71  {
72  return m_shouldBeVisible;
73  }
74 
80  const bool &getVisibleLod(const uint16& indLod)
81  {
82  return m_lodShouldBeVisible[indLod];
83  }
84 
85 protected:
90  : m_shouldBeVisible(false)
91  {
92  for (int32 ind = 0; ind < 6; ++ind)
93  {
94  m_lodShouldBeVisible[ind] = false;
95  }
96  }
97 
98 
99 protected:
108 
109 
110 };
111 
112 
113 }
114 }
115 }
116 }
117 
118 #endif // BLUB_PROCEDURAL_VOXEL_TILE_RENDERER_HPP
Definition: customVertexInformation.cpp:193
const bool & getVisible() const
getVisible returns if a tile should get rendered.
Definition: renderer.hpp:70
bool m_lodShouldBeVisible[6]
saves if crack closing submesh should get rendered.
Definition: renderer.hpp:107
Definition: sharedPointer.hpp:12
const bool & getVisibleLod(const uint16 &indLod)
getVisibleLod returns if a crack-closing lod-tile should get rendered.
Definition: renderer.hpp:80
void setTileData(t_tileDataPtr convertToRenderAble, const axisAlignedBox &aabb)
Implement this method and cast the data to your graphic engine.
Definition: renderer.hpp:45
renderer()
renderer constructor.
Definition: renderer.hpp:89
~renderer()
~renderer destructor
Definition: renderer.hpp:35
virtual void setVisibleLod(const uint16 &indLod, const bool &vis)
setVisibleLod sets if one of the 6 crack closing submeshes (for lod) should get rendered.
Definition: renderer.hpp:61
Definition: axisAlignedBox.hpp:20
virtual void setVisible(const bool &vis)
setVisible sets if a tile should get rendered. All lod-submeshes must not be rendered either...
Definition: renderer.hpp:51
Definition: deadlineTimer.hpp:10
bool m_shouldBeVisible
m_shouldBeVisible saves if tile should get rendered.
Definition: renderer.hpp:103