1 #ifndef R2C2_3D_TERRAIN_H_
2 #define R2C2_3D_TERRAIN_H_
4 #include <msp/gl/mesh.h>
5 #include <msp/gl/primitivebuilder.h>
6 #include <msp/gl/renderable.h>
7 #include <msp/gl/technique.h>
8 #include "libr2c2/terrain.h"
13 class Terrain3D: public Object3D, public Msp::GL::Renderable
18 const Msp::GL::Technique &tech;
20 static unsigned surface_indices[];
21 static unsigned wall_indices[];
24 Terrain3D(Layout3D &, Terrain &);
27 virtual Vector get_node() const;
28 virtual bool is_visible() const { return true; }
32 void gather_nodes(unsigned, unsigned, Vector *);
33 void build_triangle(Msp::GL::PrimitiveBuilder &, const Vector *, const unsigned *);
34 void update_triangle(unsigned, const Vector *, const unsigned *);
36 void size_changed(unsigned, unsigned);
37 void tile_changed(unsigned, unsigned, bool);
40 virtual void render(Msp::GL::Renderer &, const Msp::GL::Tag &) const;