fixed terrain tiles generation
[demo] / src / mesh.h
1 #ifndef MESH_H_
2 #define MESH_H_
3
4 #include <stdint.h>
5 #include <string>
6 #include <vector>
7 #include <gmath/gmath.h>
8
9 enum {
10         MESH_VERTEX = 1,
11         MESH_NORMAL = 2,
12         MESH_TEXTURE = 3,
13         MESH_INDEX = 4,
14         MESH_TANGENT = 5
15 };
16
17 class Mesh {
18 protected:
19         bool vdata_valid;
20
21 public:
22         std::vector<uint16_t> indices;
23         std::vector<Vec3> vertices;
24         std::vector<Vec3> normals;
25         std::vector<Vec2> tex_coords;
26
27         std::string name;
28
29         Mesh();
30         virtual ~Mesh() = 0;
31
32         virtual void draw() const = 0;
33         virtual void draw_normals(float scale) const = 0;
34         virtual void update_vertex_data() = 0;
35         virtual void transform(const Mat4 &mat);
36         virtual void invalidate();
37 };
38
39 #endif // MESH_H_