clray

view src/mesh.h @ 12:85fd61f374d9

fixed the bloody intersection bug
author John Tsiombikas <nuclear@member.fsf.org>
date Tue, 03 Aug 2010 13:06:59 +0100
parents a09622aaa043
children 407935b73af3
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 load(const char *fname);
38 bool load(FILE *fp);
39 };
41 #endif /* MESH_H_ */