1 2 #ifndef __MODEL_H_ 3 #define __MODEL_H_ 4 5 #include <vector> 6 7 #include "Mesh.h" 8 9 10 namespace mdl 11 { 12 13 14 struct MDLModelVertexData 15 { 16 // No useful values are stored in the file for this structure, but we 17 // need the size to be right so we can properly read subsequent models 18 // from the file 19 int vertex_data_ptr; 20 int tangent_data_ptr; 21 }; 22 23 24 struct MDLModel 25 { 26 char model_name[64]; 27 int model_type; 28 float bounding_radius; 29 int num_meshes; 30 int mesh_offset; 31 32 int num_vertices; 33 int vertex_index; 34 int tangents_index; 35 36 int num_attachments; 37 int attachment_offset; 38 int num_eyeballs; 39 int eyeball_offset; 40 41 MDLModelVertexData vertex_data; 42 43 int unused_array[8]; 44 }; 45 46 47 48 class Model 49 { 50 protected: 51 52 typedef std::vector<Mesh *> MeshList; 53 54 MDLModel * my_model; 55 56 MeshList model_meshes; 57 58 public: 59 60 Model(MDLModel * myModel); 61 virtual ~Model(); 62 63 MDLModel * getModel(); 64 65 int getVertexBase(); 66 67 void addMesh(Mesh * newMesh); 68 int getNumMeshes(); 69 Mesh * getMesh(int meshIndex); 70 }; 71 72 73 } 74 75 #endif 76 77