clray

annotate src/mesh.h @ 13:407935b73af3

bollocks
author John Tsiombikas <nuclear@member.fsf.org>
date Wed, 04 Aug 2010 04:51:06 +0100
parents 85fd61f374d9
children 29f9330cfa4b
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);
nuclear@13 38
nuclear@13 39 int get_num_faces() const;
nuclear@13 40
nuclear@6 41 bool load(const char *fname);
nuclear@6 42 bool load(FILE *fp);
nuclear@6 43 };
nuclear@6 44
nuclear@6 45 #endif /* MESH_H_ */