clray

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