Page principale | Liste des namespaces | Hiérarchie des classes | Liste par ordre alphabétique | Liste des composants | Liste des fichiers | Membres des namespaces | Composants | Déclarations

ExCMeshLOD3ds.cpp

Aller à la documentation de ce fichier.
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 
00021  *
00022  */
00023 
00024 #include "ExCMeshLOD3ds.h"
00025 
00026 ExCMeshLOD3ds::ExCMeshLOD3ds()
00027 {
00028 Guard(ExCMeshLOD3ds::ExCMeshLOD3ds())
00029         SetName("ExCMeshLOD3ds");
00030         SetType(typeid(this).name());
00031 UnGuard
00032 }
00033 
00034 ExCMeshLOD3ds::~ExCMeshLOD3ds()
00035 {
00036 Guard(ExCMeshLOD3ds::~ExCMeshLOD3ds())
00037 UnGuard
00038 }
00039 
00040 void ExCMeshLOD3ds::Draw(void)
00041 {
00042 Guard(void ExCMeshLOD3ds::Draw(void))
00043 if(!m_Visible)return;
00044         ExCMatrix4x4 MAtrix;
00045         glGetFloatv(GL_MODELVIEW_MATRIX, MAtrix.m_Matrix);
00046         std::cout<<MAtrix<<std::endl;
00047         
00048 
00049         /*m.m_Matrix[0]<<"]"<<"["<<m.m_Matrix[4]<<"]"<<"["<<m.m_Matrix[8]<<"]"<<"["<<m.m_Matrix[12]<<"]|"<<std::endl;
00050         m.m_Matrix[1]<<"]"<<"["<<m.m_Matrix[5]<<"]"<<"["<<m.m_Matrix[9]<<"]"<<"["<<m.m_Matrix[13]<<"]|"<<std::endl;
00051         m.m_Matrix[2]<<"]"<<"["<<m.m_Matrix[6]<<"]"<<"["<<m.m_Matrix[10]<<"]"<<"["<<m.m_Matrix[14]<<"]|"<<std::endl;
00052         */
00053         ExCVec3D Vec,Vec2;
00054         Vec.SetX(MAtrix.m_Matrix[0]+MAtrix.m_Matrix[1]+MAtrix.m_Matrix[2]);
00055         Vec.SetY(MAtrix.m_Matrix[4]+MAtrix.m_Matrix[5]+MAtrix.m_Matrix[6]);
00056         Vec.SetZ(MAtrix.m_Matrix[8]+MAtrix.m_Matrix[9]+MAtrix.m_Matrix[10]);
00057 
00058         Vec2.SetValue(MAtrix.m_Matrix[12],MAtrix.m_Matrix[13],MAtrix.m_Matrix[14]);
00059         std::cout<<Vec2<<std::endl;
00060 
00061         std::cout<<DistanceBeteweenTwoPoint(Vec2,m_Position);
00062 
00063         if(DistanceBeteweenTwoPoint(Vec2,m_Position)>m_DistanceForModel)
00064         {
00065                 m_LowModel.Draw();return;
00066         }
00067         if(DistanceBeteweenTwoPoint(Vec2,m_Position)>m_DistanceForModelHigh)
00068         {
00069                 m_NormalModel.Draw();return;
00070         }
00071         m_HighModel.Draw();
00072 UnGuard
00073 }
00074 
00075 bool ExCMeshLOD3ds::Load(std::string FileName)
00076 {
00077 Guard(bool ExCMeshLOD3ds::Load(std::string FileName))
00078         FileName="../Data/Mesh/"+FileName;
00079         m_HighLevel=ExNihilo::ExtracStringValueFromFile(FileName,"<ModelHigh>","<#ModelHigh>");
00080         m_DistanceForModelHigh=ExNihilo::ExtractFloatValueFromFile(FileName,"<DistanceForModelHigh>","<#DistanceForModelHigh>");
00081         m_NormalLevel=ExNihilo::ExtracStringValueFromFile(FileName,"<Model>","<#Model>");
00082         m_DistanceForModel=ExNihilo::ExtractFloatValueFromFile(FileName,"<DistanceForModel>","<#DistanceForModel>");
00083         m_LowLevel=ExNihilo::ExtracStringValueFromFile(FileName,"<ModelLow>","<#ModelLow>");
00084 
00085         m_HighModel.SetManagerTexture(ManagerTexture);
00086         m_HighModel.Load("../Data/Modeles/"+m_HighLevel);
00087 
00088         m_NormalModel.SetManagerTexture(ManagerTexture);
00089         m_NormalModel.Load("../Data/Modeles/"+m_NormalLevel);
00090 
00091         m_LowModel.SetManagerTexture(ManagerTexture);
00092         m_LowModel.Load("../Data/Modeles/"+m_LowLevel);
00093 UnGuard
00094 }

Généré le Tue Oct 28 12:43:31 2003 pour ExNihilo par doxygen 1.3.4