dungeon_crawler

view prototype/src/mesh.h @ 7:8fb37db44fd8

first person motion
author John Tsiombikas <nuclear@member.fsf.org>
date Fri, 17 Aug 2012 14:29:37 +0300
parents 158de53b4e18
children e5567ddbf2ef
line source
1 #ifndef MESH_H_
2 #define MESH_H_
4 #include <string>
5 #include <assimp/scene.h>
6 #include "vmath.h"
8 enum {
9 MESH_ATTR_VERTEX,
10 MESH_ATTR_NORMAL,
11 MESH_ATTR_TANGENT,
12 MESH_ATTR_TEXCOORD,
14 NUM_MESH_ATTR
15 };
18 class Mesh {
19 private:
20 std::string name;
22 unsigned int nverts, nfaces;
24 unsigned int vbo[NUM_MESH_ATTR];
25 unsigned int ibo;
27 int tang_loc;
29 Matrix4x4 xform;
31 public:
32 Mesh();
33 ~Mesh();
35 void set_name(const char *name);
36 const char *get_name() const;
38 bool create(const aiScene *scn, aiMesh *aim);
39 void destroy();
41 void set_xform(const Matrix4x4 &mat);
42 const Matrix4x4 &get_xform() const;
44 void set_attrib_location(int attr, int loc);
45 int get_attrib_location(int attr) const;
47 void draw() const;
48 };
50 #endif // MESH_H_