00001 00002 00003 #ifndef MESHMODEL_H 00004 #define MESHMODEL_H 00005 00006 00007 #include "RenderableObject.h" 00008 #include "Vector3f.h" 00009 00010 #include <vector> 00011 00012 00013 namespace pge { 00014 00015 00016 class AABB; 00017 class Mesh; 00018 00019 00020 class MeshModel : public IRenderableObject { 00021 00022 public: 00023 //************************************************************************ 00024 // 00025 // Constructor 00026 // 00027 //************************************************************************ 00029 MeshModel(void); 00030 00031 00032 //************************************************************************ 00033 // 00034 // Destructor 00035 // 00036 //************************************************************************ 00038 virtual ~MeshModel(void); 00039 00040 00041 //************************************************************************ 00042 // 00043 // Functions 00044 // 00045 //************************************************************************ 00046 bool init(void); 00047 void render(void); 00048 void timer(unsigned int delay); 00049 00050 std::vector<Mesh*>* getMeshs(void); 00051 int getTriangleNum(void); 00052 int getMeshNum(void); 00053 AABB* getBoundingBox(void); 00054 void addMesh(Mesh *mesh); 00055 void addMeshModel(MeshModel *model); 00056 void clearMeshs(void); 00057 float getHeightAt(float posX, float posZ); 00058 void buildBoundingBox(void); 00059 void scale(float f); 00060 void setBottomCenter(Vector3f bottomCenter); 00061 Vector3f getBottomCenterDifference(void); 00062 00063 00064 private: 00065 //************************************************************************ 00066 // 00067 // Functions 00068 // 00069 //************************************************************************ 00070 00071 00072 //************************************************************************ 00073 // 00074 // Variables 00075 // 00076 //************************************************************************ 00077 std::vector<Mesh*> *m_meshs; 00078 00079 // Bounding box. 00080 AABB *m_boundingBox; 00081 Vector3f m_bottomCenterDifference; 00082 }; 00083 }; 00084 00085 #endif