Update of /cvsroot/epfl/tgengine-0.1 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3041 Modified Files: Doxyfile base.cc base.h camera.cc console.cc console.h engine.cc engine.h function.h glrenderer.cc glrenderer.h glrenderernv15.cc guibutton.cc guicontainer.cc md5mesh10.cc physicengine.cc physicengine.h q3bsp.cc q3bsp.h renderer.h scenemanager.cc scenemanager.h scenenode.cc scenenode.h texture.cc texturemanager.cc Removed Files: cube.cc cube.h d3map.cc d3map.h log.cc log.h md2mesh.cc md2mesh.h md5mesh.cc md5mesh.h md5meshdata.cc md5meshdata.h modelloader.cc modelloader.h polyexplosion.cc polyexplosion.h positionallight.cc positionallight.h quad.cc Log Message: Beaucoup de changements : -pas mal de classes inutiles (md2, md5 version 6, autres trucs de debug) supprimées -refonte d'une bonne partie de la physique & gestion de la console Index: function.h =================================================================== RCS file: /cvsroot/epfl/tgengine-0.1/function.h,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** function.h 26 Sep 2004 13:15:24 -0000 1.1.1.1 --- function.h 21 Oct 2004 21:18:28 -0000 1.2 *************** *** 10,15 **** { public: ! inline void operator () (const std::string& s) { return exec(s); } ! virtual void exec (const std::string& ) = 0; }; --- 10,15 ---- { public: ! inline void operator () (const std::string& s, int i) { return Exec(s,i); } ! virtual void Exec (const std::string&,int ) = 0; }; Index: Doxyfile =================================================================== RCS file: /cvsroot/epfl/tgengine-0.1/Doxyfile,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** Doxyfile 26 Sep 2004 13:15:20 -0000 1.1.1.1 --- Doxyfile 21 Oct 2004 21:18:28 -0000 1.2 *************** *** 1,4 **** - # Doxyfile 1.3.5-KDevelop - #--------------------------------------------------------------------------- # Project related configuration options --- 1,2 ---- *************** *** 25,29 **** INLINE_INHERITED_MEMB = NO FULL_PATH_NAMES = NO ! STRIP_FROM_PATH = /home/silver/Terminal_G33k/tgengine/ SHORT_NAMES = NO JAVADOC_AUTOBRIEF = NO --- 23,27 ---- INLINE_INHERITED_MEMB = NO FULL_PATH_NAMES = NO ! STRIP_FROM_PATH = /home/silver/Terminal_G33k/tgengine-0.1/ SHORT_NAMES = NO JAVADOC_AUTOBRIEF = NO *************** *** 75,79 **** # configuration options related to the input files #--------------------------------------------------------------------------- ! INPUT = /home/silver/Terminal_G33k/tgengine FILE_PATTERNS = *.c \ *.cc \ --- 73,77 ---- # configuration options related to the input files #--------------------------------------------------------------------------- ! INPUT = /home/silver/Terminal_G33k/tgengine-0.1 FILE_PATTERNS = *.c \ *.cc \ --- d3map.h DELETED --- Index: renderer.h =================================================================== RCS file: /cvsroot/epfl/tgengine-0.1/renderer.h,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** renderer.h 26 Sep 2004 13:15:14 -0000 1.1.1.1 --- renderer.h 21 Oct 2004 21:18:28 -0000 1.2 *************** *** 6,11 **** #include "material.h" #include "particleemitter.h" - #include "cube.h" - #include "positionallight.h" #include "camera.h" #include "font.h" --- 6,9 ---- *************** *** 16,20 **** { ! class Renderer : public Base { public: --- 14,18 ---- { ! class Renderer : public Base, public Function { public: *************** *** 47,58 **** //virtual void BeginBump () = 0; //virtual void EndBump () = 0; ! class funcWireFrame: public Function { public: void exec (const std::string& s); ! } fWireFrame; virtual void Render2DImage (Image2D*) = 0; - virtual void SetPositionalLight (PositionalLight*) = 0; - virtual void ToggleBSDisplay () = 0; --- 45,63 ---- //virtual void BeginBump () = 0; //virtual void EndBump () = 0; + enum { + WIREFRAME=1, + }; ! void Exec (const std::string& s, int arg) { ! switch (arg) { ! case WIREFRAME: ToggleWireFrame(); break; ! default: break; ! } ! } ! ! void WireFrame (const std::string& s); virtual void Render2DImage (Image2D*) = 0; virtual void ToggleBSDisplay () = 0; --- md2mesh.cc DELETED --- --- md5mesh.cc DELETED --- Index: engine.h =================================================================== RCS file: /cvsroot/epfl/tgengine-0.1/engine.h,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** engine.h 15 Oct 2004 13:08:33 -0000 1.3 --- engine.h 21 Oct 2004 21:18:28 -0000 1.4 *************** *** 38,41 **** --- 38,42 ---- #include "logbuffer.h" #include "errbuffer.h" + #include "meshmanager.h" namespace tg *************** *** 50,54 **** */ ! class Engine : public Base { public: --- 51,55 ---- */ ! class Engine : public Base, public Function { public: *************** *** 57,61 **** */ Engine (Timer* t); ! ~Engine (); //static Renderer* pRenderer; static GLRenderer* pRenderer; --- 58,62 ---- */ Engine (Timer* t); ! virtual ~Engine (); //static Renderer* pRenderer; static GLRenderer* pRenderer; *************** *** 64,67 **** --- 65,69 ---- static Console* pConsole; static Endian* pEndian; + static MeshManager* pMeshManager; //static TextureManager* pTextureManager; *************** *** 82,88 **** void ResizeScreen (int sW, int iH, bool fS=false, bool reinit=false); ! ! class funcResize: public Function { public: void exec (const std::string& s); ! } fResize; int* GetScreenWidth () { return &screenWidth; } --- 84,100 ---- void ResizeScreen (int sW, int iH, bool fS=false, bool reinit=false); ! ! enum { ! RESIZE=1 ! }; ! ! void Exec (const std::string& s, int arg) { ! switch(arg) { ! case RESIZE: Resize(s); break; ! default: break; ! } ! } ! ! void Resize(const std::string& s); int* GetScreenWidth () { return &screenWidth; } --- polyexplosion.cc DELETED --- Index: glrenderer.h =================================================================== RCS file: /cvsroot/epfl/tgengine-0.1/glrenderer.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** glrenderer.h 28 Sep 2004 09:44:26 -0000 1.2 --- glrenderer.h 21 Oct 2004 21:18:28 -0000 1.3 *************** *** 59,63 **** virtual void EndShadow (); virtual void RenderParticles (ParticleEmitter*); - virtual void SetPositionalLight (PositionalLight*); virtual void ToggleBSDisplay (); virtual void SetCamera (Camera* c) { pCamera = c; } --- 59,62 ---- *************** *** 103,109 **** GLuint iCellShader; //Debug ! std::vector <arrow*> arrows; ! ! PositionalLight* pLight; GLuint iShaderTexture; --- 102,106 ---- GLuint iCellShader; //Debug ! std::vector <arrow*> arrows; GLuint iShaderTexture; Index: base.h =================================================================== RCS file: /cvsroot/epfl/tgengine-0.1/base.h,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** base.h 26 Sep 2004 13:15:04 -0000 1.1.1.1 --- base.h 21 Oct 2004 21:18:28 -0000 1.2 *************** *** 11,15 **** { public: - void Log( const char* msg, ...); }; --- 11,14 ---- Index: scenenode.h =================================================================== RCS file: /cvsroot/epfl/tgengine-0.1/scenenode.h,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** scenenode.h 15 Oct 2004 13:59:04 -0000 1.3 --- scenenode.h 21 Oct 2004 21:18:28 -0000 1.4 *************** *** 17,30 **** { public: ! bool bNoClip; bool bIsCamera; ! bool bOnGround; SceneNode (); SceneNode (Vector3 p); ! void SetPhysicCallBack(PhysicCallBack*); ! inline PhysicCallBack* GetPhysicCallBack() { return pPhysicCallBack; } virtual ~SceneNode () {} virtual void PreRender (float ) = 0; /* Position */ --- 17,32 ---- { public: ! //bool bNoClip; bool bIsCamera; ! //bool bOnGround; SceneNode (); SceneNode (Vector3 p); ! //void SetPhysicCallBack(PhysicCallBack*); ! //inline PhysicCallBack* GetPhysicCallBack() { return pPhysicCallBack; } virtual ~SceneNode () {} virtual void PreRender (float ) = 0; + + inline BoundingBox* GetBBox () { return pBBox; } /* Position */ *************** *** 32,48 **** Vector3 GetPosition () { return vPosition; } - /* Acceleration */ - Vector3 GetAccel () { return vAccel; } - virtual void SetAccel (const Vector3& v) { vAccel = v; } - inline float GetXAccel () { return vAccel.x; } - inline float GetYAccel () { return vAccel.y; } - inline float GetZAccel () { return vAccel.z; } - inline void SetXAccel (float f) { vAccel.x = f; } - inline void SetYAccel (float f) { vAccel.y = f; } - inline void SetZAccel (float f) { vAccel.z = f; } - inline void AddXAccel (float f) { vAccel.x += f; } - inline void AddYAccel (float f) { vAccel.y += f; } - inline void AddZAccel (float f) { vAccel.z += f; } - /* Rotation */ Vector3 GetEuler () { return vEuler; } --- 34,37 ---- *************** *** 57,81 **** inline void AddYRot (float f) { vEuler.y += f; } inline void AddZRot (float f) { vEuler.z += f; } - - /* Vitesse */ - Vector3 GetVelocity () { return vVelocity; } - virtual void SetVelocity (const Vector3& v) { vVelocity = v; } - inline float GetXVelocity () { return vVelocity.x; } - inline float GetYVelocity () { return vVelocity.y; } - inline float GetZVelocity () { return vVelocity.z; } - inline void SetXVelocity (float f) { vVelocity.x = f; } - inline void SetYVelocity (float f) { vVelocity.y = f; } - inline void SetZVelocity (float f) { vVelocity.z = f; } - inline void AddXVelocity (float f) { vVelocity.x += f; } - inline void AddYVelocity (float f) { vVelocity.y += f; } - inline void AddZVelocity (float f) { vVelocity.z += f; } - /* Autres */ ! virtual void CalculateBoundingVolume (); virtual bool Trace (Vector3 Begin, Vector3 End, Vector3& colPoint, Vector3& colNormal); ! BoundingBox* pBBox; int iLeaf; --- 46,56 ---- inline void AddYRot (float f) { vEuler.y += f; } inline void AddZRot (float f) { vEuler.z += f; } /* Autres */ ! //virtual void CalculateBoundingVolume (); virtual bool Trace (Vector3 Begin, Vector3 End, Vector3& colPoint, Vector3& colNormal); ! //BoundingBox* pBBox; int iLeaf; *************** *** 83,93 **** float fTime; protected: ! PhysicCallBack* pPhysicCallBack; Vector3 vEuler; Vector3 vPosition; ! Vector3 vAccel; ! Vector3 vVelocity; ! }; --- 58,69 ---- float fTime; protected: ! //PhysicCallBack* pPhysicCallBack; Vector3 vEuler; Vector3 vPosition; ! ! BoundingBox* pBBox; ! //Vector3 vAccel; ! //Vector3 vVelocity; }; --- cube.h DELETED --- Index: q3bsp.cc =================================================================== RCS file: /cvsroot/epfl/tgengine-0.1/q3bsp.cc,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** q3bsp.cc 15 Oct 2004 13:59:04 -0000 1.7 --- q3bsp.cc 21 Oct 2004 21:18:28 -0000 1.8 *************** *** 239,253 **** #ifdef DEBUG ! std::cout << "nombre de vertices :\t" << numOfVerts << std::endl; ! std::cout << "nombre de faces :\t" << numOfFaces << std::endl; ! std::cout << "nombre de textures:\t" << numOfTextures << std::endl; ! std::cout << "nombre de nodes:\t" << numOfNodes << std::endl; ! std::cout << "nombre de leafs:\t" << numOfLeafs << std::endl; ! std::cout << "nombre de leaffaces:\t" << numOfLeafFaces << std::endl; ! std::cout << "nombre de plans:\t" << numOfPlanes << std::endl; ! std::cout << "nombre de leafbrushes:\t" << numOfLeafBrushes << std::endl; ! std::cout << "nombre de brushes:\t" << numOfBrushes << std::endl; ! std::cout << "nombre de brushsides:\t" << numOfBrushSides << std::endl; ! std::cout << "nombre de meshindices:\t" << numOfMeshIndices << std::endl; #endif --- 239,253 ---- #ifdef DEBUG ! std::cout << "[TGE] nombre de vertices :\t" << numOfVerts << std::endl; ! std::cout << "[TGE] nombre de faces :\t" << numOfFaces << std::endl; ! std::cout << "[TGE] nombre de textures:\t" << numOfTextures << std::endl; ! std::cout << "[TGE] nombre de nodes:\t" << numOfNodes << std::endl; ! std::cout << "[TGE] nombre de leafs:\t" << numOfLeafs << std::endl; ! std::cout << "[TGE] nombre de leaffaces:\t" << numOfLeafFaces << std::endl; ! std::cout << "[TGE] nombre de plans:\t" << numOfPlanes << std::endl; ! std::cout << "[TGE] nombre de leafbrushes:\t" << numOfLeafBrushes << std::endl; ! std::cout << "[TGE] nombre de brushes:\t" << numOfBrushes << std::endl; ! std::cout << "[TGE] nombre de brushsides:\t" << numOfBrushSides << std::endl; ! std::cout << "[TGE] nombre de meshindices:\t" << numOfMeshIndices << std::endl; #endif *************** *** 276,279 **** --- 276,280 ---- pVerts[i].vPosition.y /= MAPFACTOR; pVerts[i].vPosition.z /= MAPFACTOR; + //pVerts[i].vTextureCoord[0] = 1 - pVerts[i].vTextureCoord[0]; *************** *** 290,293 **** --- 291,295 ---- } + //positionement sur le debut de la section faces pFD.seekg(lumps[kFaces].offset); *************** *** 338,343 **** } ! std::cout << "nombre de patches:\t" << numOfPatches << std::endl; ! std::cout << "nombre de faces polygonales:\t" << numOfPolygonFaces << std::endl; pPatches = new BspPatch[numOfPatches]; --- 340,345 ---- } ! std::cout << "[TGE] nombre de patches:\t" << numOfPatches << std::endl; ! std::cout << "[TGE] nombre de faces polygonales:\t" << numOfPolygonFaces << std::endl; pPatches = new BspPatch[numOfPatches]; *************** *** 366,369 **** --- 368,373 ---- pof->numOfVerts = pFaces[i].numOfVerts; pof->lightmapID = pFaces[i].lightmapID; + pof->numOfMeshVerts = pFaces[i].numMeshVerts; + pof->firstMeshIndex = pFaces[i].meshVertIndex; //Calcul du centre et du "rayon" de la face *************** *** 581,585 **** //std::cout << "-------------------" << std::endl; numOfEntities = eCount; ! std::cout << "nombre d'entites:\t" << numOfEntities << std::endl; pEntities = new BspEntity[numOfEntities+1]; --- 585,589 ---- //std::cout << "-------------------" << std::endl; numOfEntities = eCount; ! std::cout << "[TGE] nombre d'entites:\t" << numOfEntities << std::endl; pEntities = new BspEntity[numOfEntities+1]; *************** *** 649,654 **** tLevelInfos.pPointLights=new PointLight[tLevelInfos.iNumPointLights]; tLevelInfos.pStartPoints=new Vector3[tLevelInfos.iNumStartPoints]; ! std::cout << "nombre de point de depart : " << tLevelInfos.iNumStartPoints << std::endl; ! std::cout << "nombre de lights : " << tLevelInfos.iNumPointLights << std::endl; int count = 0; --- 653,658 ---- tLevelInfos.pPointLights=new PointLight[tLevelInfos.iNumPointLights]; tLevelInfos.pStartPoints=new Vector3[tLevelInfos.iNumStartPoints]; ! std::cout << "[TGE] nombre de point de depart : " << tLevelInfos.iNumStartPoints << std::endl; ! std::cout << "[TGE] nombre de lights : " << tLevelInfos.iNumPointLights << std::endl; int count = 0; *************** *** 1068,1078 **** (*_glClientActiveTextureARB)(GL_TEXTURE0_ARB); ! glTexCoordPointer(2, GL_FLOAT, sizeof(BspVertex), pVerts[0].vTextureCoord); (*_glClientActiveTextureARB)(GL_TEXTURE1_ARB); ! glTexCoordPointer(2, GL_FLOAT, sizeof(BspVertex), pVerts[0].vLightmapCoord); ! glVertexPointer(3, GL_FLOAT, sizeof(BspVertex), &pVerts[0].vPosition); ! glDrawArrays(GL_TRIANGLE_FAN, pFace->startVertIndex, pFace->numOfVerts); continue; } --- 1072,1083 ---- (*_glClientActiveTextureARB)(GL_TEXTURE0_ARB); ! glTexCoordPointer(2, GL_FLOAT, sizeof(BspVertex), pVerts[pFace->startVertIndex].vTextureCoord); (*_glClientActiveTextureARB)(GL_TEXTURE1_ARB); ! glTexCoordPointer(2, GL_FLOAT, sizeof(BspVertex), pVerts[pFace->startVertIndex].vLightmapCoord); ! glVertexPointer(3, GL_FLOAT, sizeof(BspVertex), &pVerts[pFace->startVertIndex].vPosition); ! //glDrawArrays(GL_TRIANGLE_FAN, pFace->startVertIndex, pFace->numOfVerts); ! glDrawElements (GL_TRIANGLES, pFace->numOfMeshVerts, GL_UNSIGNED_INT, &pMeshIndices[pFace->firstMeshIndex]); continue; } Index: scenemanager.h =================================================================== RCS file: /cvsroot/epfl/tgengine-0.1/scenemanager.h,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** scenemanager.h 15 Oct 2004 14:07:32 -0000 1.3 --- scenemanager.h 21 Oct 2004 21:18:28 -0000 1.4 *************** *** 9,18 **** #include "timer.h" #include "particleemitter.h" - #include "cube.h" #include "q3bsp.h" #include "dlinkednode.h" #include "pointlight.h" - //#include "d3map.h" - #include <string> #include <map> --- 9,15 ---- *************** *** 23,34 **** class Engine; - struct CollisionResult - { - Vector3 EndPoint; - Vector3 Normal; - //le node qui a ete touche. NULL si c'est la carte qui est touche ou si rien n'est touche - SceneNode* pNode; - }; - class SceneManager : public Base { --- 20,23 ---- *************** *** 62,66 **** //void SetLevel(D3Map* d) { pD3Level = d; } ! CollisionResult Trace (Vector3 Begin, Vector3 End); protected: --- 51,55 ---- //void SetLevel(D3Map* d) { pD3Level = d; } ! inline CollisionResult Trace (Vector3 Begin, Vector3 End) { return pPhysicEngine->Trace(Begin, End); } protected: Index: console.h =================================================================== RCS file: /cvsroot/epfl/tgengine-0.1/console.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** console.h 15 Oct 2004 13:08:33 -0000 1.2 --- console.h 21 Oct 2004 21:18:28 -0000 1.3 *************** *** 11,15 **** { ! class Console { protected: --- 11,15 ---- { ! class Console: public Function { protected: *************** *** 25,37 **** void _ParseCommand (std::string); ! typedef std::map <std::string, Function*> functionMap; functionMap mFunctions; public: ! class funcSet: public Function { public: void exec (const std::string& s); } fSet; class funcGet: public Function { public: void exec (const std::string& s); ! } fGet; Console (CVarManager*); //affichage void SetHistoryLength (int l); --- 25,59 ---- void _ParseCommand (std::string); ! struct FuncDesc { ! Function* pFunc; ! int iArg; ! }; ! ! typedef std::map <std::string, FuncDesc*> functionMap; functionMap mFunctions; + + enum { + GET=1, + SET=2 + }; public: ! /*class funcSet: public Function { public: void exec (const std::string& s); } fSet; class funcGet: public Function { public: void exec (const std::string& s); ! } fGet;*/ ! ! void Exec (const std::string& s, int arg) { ! switch(arg) { ! case GET: Get(s); break; ! case SET: Set(s); break; ! default: break; ! } ! } ! ! void Set(const std::string& s); ! void Get(const std::string& s); Console (CVarManager*); + virtual ~Console() {} //affichage void SetHistoryLength (int l); *************** *** 52,56 **** void Output (const std::string&); //enregistrement fonctions ! void Register (std::string, Function*); }; --- 74,78 ---- void Output (const std::string&); //enregistrement fonctions ! void Register (std::string, Function*, int); }; --- md5meshdata.h DELETED --- Index: camera.cc =================================================================== RCS file: /cvsroot/epfl/tgengine-0.1/camera.cc,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** camera.cc 10 Oct 2004 20:49:09 -0000 1.2 --- camera.cc 21 Oct 2004 21:18:28 -0000 1.3 *************** *** 40,44 **** SDL_WarpMouse (middleX, middleY); ! float factor; if (bShift) factor = 0.5f; --- 40,44 ---- SDL_WarpMouse (middleX, middleY); ! /* float factor; if (bShift) factor = 0.5f; *************** *** 46,73 **** factor = 1.0f; ! vAccel.x = 0; ! vAccel.z = 0; if(iForward >= 1) { ! vAccel.x += sinf(fYaw*DEGTORAD)*fSpeed*factor; ! vAccel.z -= cosf(fYaw*DEGTORAD)*fSpeed*factor; } else if(iForward <= -1) { ! vAccel.x -= sinf(fYaw*DEGTORAD)*fSpeed*factor; ! vAccel.z += cosf(fYaw*DEGTORAD)*fSpeed*factor; } if(iStrafe >= 1) { ! vAccel.x += cosf(fYaw*DEGTORAD)*fSpeed*factor; ! vAccel.z += sinf(fYaw*DEGTORAD)*fSpeed*factor; } else if(iStrafe <= -1) { ! vAccel.x -= cosf(fYaw*DEGTORAD)*fSpeed*factor; ! vAccel.z -= sinf(fYaw*DEGTORAD)*fSpeed*factor; ! } /*if(iForward >= 1) { --- 46,73 ---- factor = 1.0f; ! vVelocity.x = 0; ! vVelocity.z = 0; if(iForward >= 1) { ! vVelocity.x += sinf(fYaw*DEGTORAD)*fSpeed*factor; ! vVelocity.z -= cosf(fYaw*DEGTORAD)*fSpeed*factor; } else if(iForward <= -1) { ! vVelocity.x -= sinf(fYaw*DEGTORAD)*fSpeed*factor; ! vVelocity.z += cosf(fYaw*DEGTORAD)*fSpeed*factor; } if(iStrafe >= 1) { ! vVelocity.x += cosf(fYaw*DEGTORAD)*fSpeed*factor; ! vVelocity.z += sinf(fYaw*DEGTORAD)*fSpeed*factor; } else if(iStrafe <= -1) { ! vVelocity.x -= cosf(fYaw*DEGTORAD)*fSpeed*factor; ! vVelocity.z -= sinf(fYaw*DEGTORAD)*fSpeed*factor; ! }*/ /*if(iForward >= 1) { --- quad.cc DELETED --- Index: texture.cc =================================================================== RCS file: /cvsroot/epfl/tgengine-0.1/texture.cc,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** texture.cc 15 Oct 2004 13:08:33 -0000 1.7 --- texture.cc 21 Oct 2004 21:18:28 -0000 1.8 *************** *** 53,57 **** unsigned char *tempbuf; ! Log ("Chargement du TGA : %s", image); fd = fopen(image, "rb"); if(fd == NULL) --- 53,57 ---- unsigned char *tempbuf; ! std::cout << "[TGE] Chargement du TGA : " << image << std::endl; fd = fopen(image, "rb"); if(fd == NULL) *************** *** 87,91 **** if((tgaheader.imageTypeCode != TGA_RGB) && (tgaheader.imageTypeCode != TGA_GREY) && (tgaheader.imageTypeCode != TGA_RLERGB) && (tgaheader.imageTypeCode != TGA_RLEGREY)) { ! Log("LoadTGA: %s doesn't look like a TGA image\n", image); fclose(fd); return false; --- 87,91 ---- if((tgaheader.imageTypeCode != TGA_RGB) && (tgaheader.imageTypeCode != TGA_GREY) && (tgaheader.imageTypeCode != TGA_RLERGB) && (tgaheader.imageTypeCode != TGA_RLEGREY)) { ! std::cerr << "[TGE] LoadTGA: " << image << " doesn't look like a TGA image\n" << std::endl; fclose(fd); return false; *************** *** 144,148 **** } } else { ! Log("LoadTGA: %s has bad or unsupported pixel format (%d)\n", image, tgaheader.bitCount); fclose(fd); return false; --- 144,148 ---- } } else { ! std::cerr << "[TGE] LoadTGA:" << image << " has bad or unsupported pixel format (" << tgaheader.bitCount << ")" << std::endl; fclose(fd); return false; *************** *** 242,246 **** //glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_R, GL_CLAMP_TO_EDGE); - Log ("bitcount %i", iBpp); //priorite de la texture... ca ne semble pas vraiment utile //glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_PRIORITY, 1); --- 242,245 ---- *************** *** 252,256 **** glTexImage2D(GL_TEXTURE_2D, 0, iBpp, iWidth, iHeight, 0, GL_RGBA, GL_UNSIGNED_BYTE, cData); ! Log ("%s : chargement reussi", image); bLoaded = true; return true; --- 251,255 ---- glTexImage2D(GL_TEXTURE_2D, 0, iBpp, iWidth, iHeight, 0, GL_RGBA, GL_UNSIGNED_BYTE, cData); ! std::cout << "[TGE] " << image <<" : chargement reussi" << std::endl; bLoaded = true; return true; *************** *** 271,275 **** if(fd == NULL) { ! std::cerr << "Impossible de charger le fichier " << image << std::endl;; return false; } --- 270,274 ---- if(fd == NULL) { ! std::cerr << "[TGE] Impossible de charger le fichier " << image << std::endl;; return false; } *************** *** 295,299 **** if(bfheader.bfType != 0x4D42) { fclose(fd); ! Log ("ae.textureloader.LoadBMP \nError loading %s: not a valid BMP file (bmp id: %x)\n", image, bfheader.bfType); return false; } --- 294,298 ---- if(bfheader.bfType != 0x4D42) { fclose(fd); ! std::cerr << "[TGE] Le fichier " << image << " ne semble pas etre une image bmp valide : " << bfheader.bfType << std::endl; return false; } *************** *** 336,340 **** } else { fclose(fd); ! Log("ae.textureloader.LoadBMP \n%s has bad or unsupported pixel format\n", image); return false; } --- 335,339 ---- } else { fclose(fd); ! std::cerr << "[TGE] L'image " << image << " a un mauvais format de pixel" << std::endl; return false; } *************** *** 417,421 **** bool Texture::LoadPNG (char* image, texType type) { ! std::cout << "chargement de "<<image<<std::endl; SDL_Surface* texture; texture = IMG_Load(image); --- 416,420 ---- bool Texture::LoadPNG (char* image, texType type) { ! std::cout << "[TGE] chargement de "<<image<<std::endl; SDL_Surface* texture; texture = IMG_Load(image); Index: glrenderernv15.cc =================================================================== RCS file: /cvsroot/epfl/tgengine-0.1/glrenderernv15.cc,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** glrenderernv15.cc 15 Oct 2004 13:59:04 -0000 1.5 --- glrenderernv15.cc 21 Oct 2004 21:18:28 -0000 1.6 *************** *** 78,85 **** if (mesh->bCamera) glLoadIdentity (); ! ! _RotateNode(mesh); ! glTranslatef(mesh->GetPosition().x, mesh->GetPosition().y, mesh->GetPosition().z); glScalef(mesh->fScale, mesh->fScale, mesh->fScale); --- 78,86 ---- if (mesh->bCamera) glLoadIdentity (); ! ! glTranslatef(mesh->GetPosition().x, mesh->GetPosition().y, mesh->GetPosition().z); + _RotateNode(mesh); + glScalef(mesh->fScale, mesh->fScale, mesh->fScale); *************** *** 377,381 **** bWireFrame = false; ! Engine::pConsole->Register("wireframe", &fWireFrame); Engine::pVarManager->AddVar("lightpos.x", 150.0f); --- 378,382 ---- bWireFrame = false; ! Engine::pConsole->Register("wireframe", this, WIREFRAME); Engine::pVarManager->AddVar("lightpos.x", 150.0f); --- log.cc DELETED --- Index: physicengine.cc =================================================================== RCS file: /cvsroot/epfl/tgengine-0.1/physicengine.cc,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** physicengine.cc 15 Oct 2004 13:59:04 -0000 1.10 --- physicengine.cc 21 Oct 2004 21:18:28 -0000 1.11 *************** *** 17,21 **** #define MAXBUMPS 5 ! void PhysicEngine::StepSlideMove(SceneNode* n, float eTime, Vector3& vVelocity, Vector3 origin) { BspCollisionResult trace; --- 17,21 ---- #define MAXBUMPS 5 ! void PhysicEngine::StepSlideMove(PhysicNode* n, float eTime, Vector3& vVelocity, Vector3 origin) { BspCollisionResult trace; *************** *** 29,33 **** //a chaque fois qu'on rencontre un plan, on relance un trace avec comme origine le Endpoint sur le plan précédent et on ajuste la vitesse de notre objet. MAXBUMPS permet simplement d'éviter des boucles infinies { ! trace = pLevel->CheckRayMove(origin, origin+vVelocity*time_left, n->pBBox->vMin, n->pBBox->vMax); if (trace.AllSolid) --- 29,33 ---- //a chaque fois qu'on rencontre un plan, on relance un trace avec comme origine le Endpoint sur le plan précédent et on ajuste la vitesse de notre objet. MAXBUMPS permet simplement d'éviter des boucles infinies { ! trace = pLevel->CheckRayMove(origin, origin+vVelocity*time_left, n->GetBBox()->vMin, n->GetBBox()->vMax); if (trace.AllSolid) *************** *** 78,82 **** void PhysicEngine::Move (float eTime) { ! SceneNode* n; /*Vector3 vVeloc1; Vector3 vVeloc2; --- 78,82 ---- void PhysicEngine::Move (float eTime) { ! PhysicNode* n; /*Vector3 vVeloc1; Vector3 vVeloc2; *************** *** 87,93 **** { n = pNodes[i]; ! //Vector3 origin = n->GetPosition(); ! //on ajoute la gravite ! if (!n->bOnGround && !n->bNoClip) n->AddYAccel(-(*pGravity)); else if (n->GetYAccel() < 0) //si l'objet touche le sol, il faut ramener la gravité à zéro, sinon, l'objet va se retrouver avec une gravité négative très grande (ça l'empeche de sauter notamment) --- 87,103 ---- { n = pNodes[i]; ! //si l'objet ne doit pas etre géré par la physique, on continue ! if (!n->Clip()) ! { ! n->SetPosition(n->GetPosition()+n->GetVelocity()*eTime); ! n->SetRot(n->GetRot()+n->GetRotVelocity()*eTime); ! n->UpdatePosition(); ! ! continue; ! } ! ! //on a un objet qui doit subir les forces et les collisions ! ! if (!n->OnGround()) n->AddYAccel(-(*pGravity)); else if (n->GetYAccel() < 0) //si l'objet touche le sol, il faut ramener la gravité à zéro, sinon, l'objet va se retrouver avec une gravité négative très grande (ça l'empeche de sauter notamment) *************** *** 98,111 **** //int red[]={1,0,0}; //Engine::pEngine->pRenderer->drawDebugArrow(n->vPosition, n->vPosition+n->vAccel*5, red); ! n->SetVelocity(n->GetAccel()*eTime); //mise a jour des volumes englobants n->CalculateBoundingVolume(); //on test les collisions avec le monde ! if (n->bNoClip) ! { ! n->SetPosition(n->GetPosition()+n->GetVelocity()*eTime); ! continue; ! } ! if (pLevel && !n->bNoClip) { //on essaie de faire monter les petits obstacles sur les y (escaliers, rebords) au joueur. Pour cela, on test si lorsqu'on monte --- 108,118 ---- //int red[]={1,0,0}; //Engine::pEngine->pRenderer->drawDebugArrow(n->vPosition, n->vPosition+n->vAccel*5, red); ! //std::cout << n->GetVelocity() << std::endl; ! n->SetVelocity(n->GetVelocity()+n->GetAccel()*eTime); //mise a jour des volumes englobants n->CalculateBoundingVolume(); //on test les collisions avec le monde ! ! i... [truncated message content] |