clray
view src/mesh.h @ 9:a09622aaa043
moving to triangles
author | John Tsiombikas <nuclear@member.fsf.org> |
---|---|
date | Sat, 24 Jul 2010 06:28:17 +0100 |
parents | b06518bb16e9 |
children | 85fd61f374d9 |
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[2];
10 };
12 struct Face {
13 Vertex v[3];
14 float normal[4];
15 int matid;
16 };
18 struct Material {
19 float kd[4], ks[4];
20 float kr, kt;
21 float spow;
22 };
24 struct Mesh {
25 std::vector<Face> faces;
26 int matid;
27 };
29 class Scene {
30 public:
31 std::vector<Mesh*> meshes;
32 std::vector<Material> matlib;
34 bool load(const char *fname);
35 bool load(FILE *fp);
36 };
38 #endif /* MESH_H_ */