nuclear@6: #ifndef MESH_H_ nuclear@6: #define MESH_H_ nuclear@6: nuclear@6: #include nuclear@6: nuclear@6: struct Vertex { nuclear@9: float pos[4]; nuclear@9: float normal[4]; nuclear@12: float tex[4]; nuclear@12: float padding[4]; nuclear@6: }; nuclear@6: nuclear@6: struct Face { nuclear@6: Vertex v[3]; nuclear@9: float normal[4]; nuclear@6: int matid; nuclear@12: int padding[3]; John@15: John@15: bool operator ==(const Face &f) const; nuclear@6: }; nuclear@6: nuclear@6: struct Material { nuclear@9: float kd[4], ks[4]; nuclear@6: float kr, kt; nuclear@6: float spow; nuclear@12: float padding; nuclear@6: }; nuclear@6: nuclear@6: struct Mesh { nuclear@6: std::vector faces; nuclear@6: int matid; nuclear@6: }; nuclear@6: nuclear@6: class Scene { nuclear@6: public: nuclear@6: std::vector meshes; nuclear@6: std::vector matlib; nuclear@6: nuclear@13: bool add_mesh(Mesh *m); John@14: int get_num_meshes() const; John@14: int get_num_materials() const; John@14: int get_num_faces() const; nuclear@13: John@14: Material *get_materials(); John@14: const Material *get_materials() const; nuclear@13: nuclear@6: bool load(const char *fname); nuclear@6: bool load(FILE *fp); nuclear@6: }; nuclear@6: nuclear@6: #endif /* MESH_H_ */