clray

annotate src/mesh.h @ 14:29f9330cfa4b

trying to debug the bloody thing
author John Tsiombikas
date Sat, 07 Aug 2010 03:36:36 +0100
parents 407935b73af3
children 754faf15ba36
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@13 37 bool add_mesh(Mesh *m);
John@14 38 int get_num_meshes() const;
John@14 39 int get_num_materials() const;
John@14 40 int get_num_faces() const;
nuclear@13 41
John@14 42 Material *get_materials();
John@14 43 const Material *get_materials() const;
nuclear@13 44
nuclear@6 45 bool load(const char *fname);
nuclear@6 46 bool load(FILE *fp);
nuclear@6 47 };
nuclear@6 48
nuclear@6 49 #endif /* MESH_H_ */