1 #ifndef BLUB_PROCEDURAL_VOXEL_TERRAIN_RENDERER_HPP
2 #define BLUB_PROCEDURAL_VOXEL_TERRAIN_RENDERER_HPP
4 #include "blub/core/vector.hpp"
5 #include "blub/procedural/voxel/terrain/base.hpp"
7 #include <boost/function/function_fwd.hpp>
23 template <
class configType>
24 class renderer :
public base<typename configType::t_renderer::t_simple>
28 typedef typename t_config::t_renderer::t_simple t_simple;
29 typedef base<t_simple> t_base;
30 typedef sharedPointer<sync::identifier> t_cameraPtr;
32 typedef vector<real> t_syncRadiusList;
34 typedef typename t_config::t_surface::t_terrain t_rendererSurface;
44 t_rendererSurface &renderer_,
45 const t_syncRadiusList& syncRadien)
47 , m_terrain(renderer_)
48 , m_syncRadien(syncRadien)
50 BASSERT(m_terrain.getNumLod() <= (int32)m_syncRadien.size());
52 for (uint32 indLod = 0; indLod < (uint32)m_terrain.getNumLod(); ++indLod)
56 t_base::m_lods.emplace_back(
new t_simple(m_worker, m_terrain.getLod(indLod), indLod, 0., syncRadien[0]));
60 t_base::m_lods.emplace_back(
new t_simple(m_worker, m_terrain.getLod(indLod), indLod, syncRadien[indLod-1], syncRadien[indLod]));
113 t_rendererSurface &m_terrain;
115 t_syncRadiusList m_syncRadien;
126 #endif // BLUB_PROCEDURAL_VOXEL_TERRAIN_RENDERER_HPP
void updateCamera(t_cameraPtr toUpdate, const blub::vector3 &position)
updateCamera updates the position of a camera you have to add before by using addCamera() ...
Definition: renderer.hpp:89
void removeCamera(t_cameraPtr toRemove)
removeCamera removes a camera.
Definition: renderer.hpp:100
Definition: customVertexInformation.cpp:193
renderer(blub::async::dispatcher &worker, t_rendererSurface &renderer_, const t_syncRadiusList &syncRadien)
renderer constructor
Definition: renderer.hpp:43
t_lodList m_lods
m_lods container for the lods.
Definition: base.hpp:78
void addCamera(t_cameraPtr toAdd, const blub::vector3 &position)
addCamera adds an camera.
Definition: renderer.hpp:77
Definition: dispatcher.hpp:29
~renderer()
~renderer destructor
Definition: renderer.hpp:68
Definition: vector3.hpp:26
Definition: deadlineTimer.hpp:10