clray

view src/mesh.h @ 14:29f9330cfa4b

trying to debug the bloody thing
author John Tsiombikas
date Sat, 07 Aug 2010 03:36:36 +0100
parents 407935b73af3
children 754faf15ba36
line source
1 #ifndef MESH_H_
2 #define MESH_H_
4 #include <vector>
6 struct Vertex {
7 float pos[4];
8 float normal[4];
9 float tex[4];
10 float padding[4];
11 };
13 struct Face {
14 Vertex v[3];
15 float normal[4];
16 int matid;
17 int padding[3];
18 };
20 struct Material {
21 float kd[4], ks[4];
22 float kr, kt;
23 float spow;
24 float padding;
25 };
27 struct Mesh {
28 std::vector<Face> faces;
29 int matid;
30 };
32 class Scene {
33 public:
34 std::vector<Mesh*> meshes;
35 std::vector<Material> matlib;
37 bool add_mesh(Mesh *m);
38 int get_num_meshes() const;
39 int get_num_materials() const;
40 int get_num_faces() const;
42 Material *get_materials();
43 const Material *get_materials() const;
45 bool load(const char *fname);
46 bool load(FILE *fp);
47 };
49 #endif /* MESH_H_ */