clray

annotate 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
rev   line source
nuclear@6 1 #ifndef MESH_H_
nuclear@6 2 #define MESH_H_
nuclear@6 3
nuclear@6 4 #include <vector>
nuclear@6 5
nuclear@6 6 struct Vertex {
nuclear@9 7 float pos[4];
nuclear@9 8 float normal[4];
nuclear@6 9 float tex[2];
nuclear@6 10 };
nuclear@6 11
nuclear@6 12 struct Face {
nuclear@6 13 Vertex v[3];
nuclear@9 14 float normal[4];
nuclear@6 15 int matid;
nuclear@6 16 };
nuclear@6 17
nuclear@6 18 struct Material {
nuclear@9 19 float kd[4], ks[4];
nuclear@6 20 float kr, kt;
nuclear@6 21 float spow;
nuclear@6 22 };
nuclear@6 23
nuclear@6 24 struct Mesh {
nuclear@6 25 std::vector<Face> faces;
nuclear@6 26 int matid;
nuclear@6 27 };
nuclear@6 28
nuclear@6 29 class Scene {
nuclear@6 30 public:
nuclear@6 31 std::vector<Mesh*> meshes;
nuclear@6 32 std::vector<Material> matlib;
nuclear@6 33
nuclear@6 34 bool load(const char *fname);
nuclear@6 35 bool load(FILE *fp);
nuclear@6 36 };
nuclear@6 37
nuclear@6 38 #endif /* MESH_H_ */