00001 /* 00002 * ExNihilo 3D Engine 00003 * 00004 * This program is free software; you can redistribute it and/or modify 00005 * it under the terms of the GNU General Public License as published by 00006 * the Free Software Foundation; either version 2 of the License, or 00007 * (at your option) any later version. 00008 * 00009 * This program is distributed in the hope that it will be useful, 00010 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00011 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00012 * GNU Library General Public License for more details. 00013 * 00014 * You should have received a copy of the GNU General Public License 00015 * along with this program; if not, write to the Free Software 00016 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 00017 * 00018 * Please read AUTHORS file !!! 00019 * 00020 * $Id: ExCMap.h,v 1.8 2002/08/01 18:45:56 data Exp $ 00021 * 00022 */ 00023 00024 #ifndef __EXMAP_H__ 00025 #define __EXMAP_H__ 00026 //-------------------------------- 00027 // File to include 00028 //-------------------------------- 00029 #include "ExDefine.h" 00030 #include "ExMath.h" 00031 #include "ExManagerTexture.h" 00032 #include "ExCGizmoRectangle.h" 00033 #include "ExCFrustum.h" 00034 #include "ExCOctree.h" 00035 00036 //-------------------------------- 00037 class ExCMap 00038 { 00039 protected: 00040 //-------------------------------- 00041 // Variable 00042 //-------------------------------- 00043 00044 ExManagerTexture *ManagerTexture; 00045 00046 std::vector<ExCVertex> m_VecVertex; 00047 std::vector<ExCVertex>::iterator m_ItVecVertex; 00048 std::vector<ExCMesh> m_VecMesh; 00049 std::vector<ExCMesh>::iterator m_ItVecMesh; 00050 00051 00052 long m_NumberMesh; 00053 long m_NumberVertex; 00054 int m_RenderMode; 00055 00056 GLuint m_GlListId; 00057 GLuint m_GlSkyBoxListId; 00058 00059 bool m_ShowSkybox; 00060 bool m_ShowMesh; 00061 bool m_OctreeState; 00062 bool m_ShowOctreeSubdivision; 00063 00064 00065 00066 void DrawAllMesh(void); 00067 void DrawMeshInFrustrum(void); 00068 void BuildSkyBox(void); 00069 void BuildOctree(void); 00070 void BuilList(void); 00071 void BuildVertexArrays(void); 00072 00073 00074 00075 ExCOctree m_Octree; 00076 ExCFrustum Frustrum; 00077 public: 00078 00079 char *m_STextureBoxNameTop; 00080 char *m_STextureBoxNameBottom; 00081 char *m_STextureBoxNameFront; 00082 char *m_STextureBoxNameBack; 00083 char *m_STextureBoxNameLeft; 00084 char *m_STextureBoxNameRight; 00085 //-------------------------------- 00086 // Constructor // Destructor 00087 //-------------------------------- 00088 ExCMap(void); 00089 ~ExCMap(void); 00090 //-------------------------------- 00091 // Methode 00092 //-------------------------------- 00093 inline void ShowSkybox(void){m_ShowSkybox=true;} 00094 inline void HideSkybox(void){m_ShowSkybox=false;} 00095 inline void ShowMesh(void){m_ShowMesh=true;} 00096 inline void HideMesh(void){m_ShowMesh=false;} 00097 inline void EnableOctree(void){m_OctreeState=true;} 00098 inline void DisableOctree(void){m_OctreeState=false;} 00099 inline void ShowOctreeSubdivision(void){m_ShowOctreeSubdivision=true;} 00100 inline void HideOctreeSubdivision(void){m_ShowOctreeSubdivision=false;} 00101 00102 std::ostrstream *Consol; 00103 void (*WriteToConsol)(const char *Label); 00104 00105 inline void SetNumberMesh(long NumberMesh){m_NumberMesh=NumberMesh;} 00106 00107 inline long GetNumberMesh(void){return m_NumberMesh;} 00108 inline int GetRenderMode(void){return m_RenderMode;} 00109 inline GLuint GetGlListId(void){return m_GlListId;} 00110 inline void SetManagerTexture(ExManagerTexture * Texture){ManagerTexture=Texture;} 00111 00112 bool LoadMap(const char *FileName); 00113 void Draw(void); 00114 00115 00116 }; 00117 #endif //__EXMAP_H__