clray

view src/mesh.h @ 13:407935b73af3

bollocks
author John Tsiombikas <nuclear@member.fsf.org>
date Wed, 04 Aug 2010 04:51:06 +0100
parents 85fd61f374d9
children 29f9330cfa4b
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);
39 int get_num_faces() const;
41 bool load(const char *fname);
42 bool load(FILE *fp);
43 };
45 #endif /* MESH_H_ */