|
From: julien r. <jul...@us...> - 2004-11-17 22:43:18
|
Update of /cvsroot/epfl/tgengine-0.1 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13960 Modified Files: boundingbox.cc decalmanager.cc decalmanager.h physiccallback.h physicengine.cc physicengine.h physicnode.cc physicnode.h q3bsp.cc q3bsp.h scenemanager.cc scenemanager.h texture.cc Log Message: JPEG texture pour les map Index: physicengine.cc =================================================================== RCS file: /cvsroot/epfl/tgengine-0.1/physicengine.cc,v retrieving revision 1.24 retrieving revision 1.25 diff -C2 -d -r1.24 -r1.25 *** physicengine.cc 15 Nov 2004 21:35:21 -0000 1.24 --- physicengine.cc 17 Nov 2004 22:43:06 -0000 1.25 *************** *** 20,24 **** void PhysicEngine::StepSlideMove(PhysicNode* n, float eTime, Vector3& vVelocity, Vector3 origin) { ! BspCollisionResult trace; int bumpcount = 0; //Vector3 origin = n->pBBox->vWorldOrigin; --- 20,25 ---- void PhysicEngine::StepSlideMove(PhysicNode* n, float eTime, Vector3& vVelocity, Vector3 origin) { ! //BspCollisionResult trace; ! CollisionResult trace; int bumpcount = 0; //Vector3 origin = n->pBBox->vWorldOrigin; *************** *** 34,38 **** //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); //on trace avec une sphere, les mouvements sembles plus 'lisses' //trace = pLevel->CheckRayMove(origin+n->GetBBox()->vBSCenter, origin+n->GetBBox()->vBSCenter+vVelocity*time_left, TRACE_SPHERE, n->GetBBox()->fBSRadius); --- 35,40 ---- //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); ! trace = Trace(origin, origin+vVelocity*time_left, n->GetBBox()->vMin, n->GetBBox()->vMax, n); //on trace avec une sphere, les mouvements sembles plus 'lisses' //trace = pLevel->CheckRayMove(origin+n->GetBBox()->vBSCenter, origin+n->GetBBox()->vBSCenter+vVelocity*time_left, TRACE_SPHERE, n->GetBBox()->fBSRadius); *************** *** 54,63 **** time_left -= time_left*trace.Fraction; ! pPlanes.push_back(trace.CollisionNormal); iNumPlanes++; for (i=0; i<iNumPlanes; i++) { ! ClipVelocity (vVelocity, trace.CollisionNormal); for (j=0; j<iNumPlanes; j++) if (j != i) --- 56,65 ---- time_left -= time_left*trace.Fraction; ! pPlanes.push_back(trace.Normal); iNumPlanes++; for (i=0; i<iNumPlanes; i++) { ! ClipVelocity (vVelocity, trace.Normal); for (j=0; j<iNumPlanes; j++) if (j != i) *************** *** 137,147 **** //on verifie que ca ne nous fasse pas rentrer dans le plafond ! BspCollisionResult trace = pLevel->CheckRayMove(vUpPos, vNewPos, n->GetBBox()->vMin, n->GetBBox()->vMax); if (trace.AllSolid) vUpNewPos = trace.EndPoint; if (updist > dist) //on passe l'obstacle { ! n->SetPosition(/*Vector3(vNewPos.x, vUpNewPos.y, vNewPos.z)*/vUpNewPos); } else //l'obstacle est trop haut --- 139,153 ---- //on verifie que ca ne nous fasse pas rentrer dans le plafond ! //BspCollisionResult trace = pLevel->CheckRayMove(vUpPos, vNewPos, n->GetBBox()->vMin, n->GetBBox()->vMax); ! CollisionResult trace = Trace(vUpPos, vNewPos, n->GetBBox()->vMin, n->GetBBox()->vMax, n); if (trace.AllSolid) vUpNewPos = trace.EndPoint; + //appel de la callback pour les collisions avec la map. Ca permet aux objets style rockets de savoir s'ils doivent exploser + if (trace.Fraction < 1.0f) + n->GetPhysicCallBack()->Collide(trace.pNode, trace.EndPoint, trace.Normal); if (updist > dist) //on passe l'obstacle { ! n->SetPosition(vUpNewPos); } else //l'obstacle est trop haut *************** *** 151,155 **** //Classification de la position ! BspCollisionResult col = pLevel->CheckRayMove(n->GetPosition(), n->GetPosition()+Vector3::NEGATIVE_UNIT_Y*BASE_HEIGHT, n->GetBBox()->vMin, n->GetBBox()->vMax); //si on met le allsolid, ca foire les mouvements sur les y if (col.Fraction < 1.0f || col.AllSolid) --- 157,162 ---- //Classification de la position ! //BspCollisionResult col = pLevel->CheckRayMove(n->GetPosition(), n->GetPosition()+Vector3::NEGATIVE_UNIT_Y*BASE_HEIGHT, n->GetBBox()->vMin, n->GetBBox()->vMax); ! CollisionResult col = Trace(n->GetPosition(), n->GetPosition()+Vector3::NEGATIVE_UNIT_Y*BASE_HEIGHT, n->GetBBox()->vMin, n->GetBBox()->vMax, n); //si on met le allsolid, ca foire les mouvements sur les y if (col.Fraction < 1.0f || col.AllSolid) *************** *** 223,235 **** //TODO: Les objets doivent être classés par leaf et cela doit etre utilise pour le trace (il faudrait extraire l'arbre BSP de la map et l'envoyer au moteur physique, qui s'occuperait d'y rajouter les objets & Co) ! CollisionResult PhysicEngine::Trace (Vector3 Begin, Vector3 End, PhysicNode* edict) { //on choppe le resultat du trace sur la map CollisionResult result; result.pNode = NULL; ! ! BspCollisionResult mapResult = pLevel->CheckRayMove(Begin, End, TRACE_RAY, 0); result.EndPoint = mapResult.EndPoint; result.Normal = mapResult.CollisionNormal; //on trace sur les objets Vector3 colPoint(0,0,0); --- 230,245 ---- //TODO: Les objets doivent être classés par leaf et cela doit etre utilise pour le trace (il faudrait extraire l'arbre BSP de la map et l'envoyer au moteur physique, qui s'occuperait d'y rajouter les objets & Co) ! CollisionResult PhysicEngine::Trace (Vector3 Begin, Vector3 End, Vector3 vMin, Vector3 vMax, PhysicNode* edict) { //on choppe le resultat du trace sur la map CollisionResult result; result.pNode = NULL; ! ! BspCollisionResult mapResult = pLevel->CheckRayMove(Begin, End, vMin, vMax); ! result.EndPoint = mapResult.EndPoint; result.Normal = mapResult.CollisionNormal; + result.Fraction = mapResult.Fraction; + result.AllSolid = mapResult.AllSolid; //on trace sur les objets Vector3 colPoint(0,0,0); *************** *** 250,253 **** --- 260,265 ---- result.Normal = colNormal; result.pNode = pNodes[i]; + //result.Fraction = (End-Begin).Magnitude()/(colPoint-Begin).Magnitude(); + //result.AllSolid = false; } } Index: scenemanager.cc =================================================================== RCS file: /cvsroot/epfl/tgengine-0.1/scenemanager.cc,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** scenemanager.cc 13 Nov 2004 23:35:40 -0000 1.17 --- scenemanager.cc 17 Nov 2004 22:43:06 -0000 1.18 *************** *** 116,137 **** } - (*_glActiveTextureARB)(GL_TEXTURE0); - glDisable (GL_TEXTURE_2D); - (*_glActiveTextureARB)(GL_TEXTURE1); - glDisable (GL_TEXTURE_2D); - for (int i=0; i<pDebugSpheres.size (); i++) - { - DebugSphere* s = pDebugSpheres[i]; - glPushMatrix(); - glColor3f(s->pColors[0], s->pColors[1], s->pColors[2]); - glTranslatef(s->vPosition.x, s->vPosition.y, s->vPosition.z); - gluSphere(s->q, s->fD, 10, 10); - glPopMatrix(); - } - (*_glActiveTextureARB)(GL_TEXTURE0); - glEnable (GL_TEXTURE_2D); - (*_glActiveTextureARB)(GL_TEXTURE1); - glEnable (GL_TEXTURE_2D); - Mesh* m = pFirstObject; --- 116,119 ---- *************** *** 175,178 **** --- 157,178 ---- pDecalManager->Render(frameInterval); + (*_glActiveTextureARB)(GL_TEXTURE0); + glDisable (GL_TEXTURE_2D); + (*_glActiveTextureARB)(GL_TEXTURE1); + glDisable (GL_TEXTURE_2D); + for (int i=0; i<pDebugSpheres.size (); i++) + { + DebugSphere* s = pDebugSpheres[i]; + glPushMatrix(); + glColor3f(s->pColors[0], s->pColors[1], s->pColors[2]); + glTranslatef(s->vPosition.x, s->vPosition.y, s->vPosition.z); + gluSphere(s->q, s->fD, 10, 10); + glPopMatrix(); + } + (*_glActiveTextureARB)(GL_TEXTURE0); + glEnable (GL_TEXTURE_2D); + (*_glActiveTextureARB)(GL_TEXTURE1); + glEnable (GL_TEXTURE_2D); + PointLight* pl = pFirstPointLight; Index: q3bsp.h =================================================================== RCS file: /cvsroot/epfl/tgengine-0.1/q3bsp.h,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** q3bsp.h 12 Nov 2004 12:11:36 -0000 1.5 --- q3bsp.h 17 Nov 2004 22:43:06 -0000 1.6 *************** *** 265,268 **** --- 265,275 ---- }; + struct BspShader + { + char strName[64]; //le nom du shader + int brush; //le brush qui génère cet effet + int unknown; // toujours 5, sauf q3dm8 qui en a un à -1 + }; + //END STRUCT TextureManager* pTexManager; *************** *** 281,284 **** --- 288,292 ---- int numOfMeshIndices; int numOfEntities; + int numOfShaders; int numOfLeafBrushes; *************** *** 302,305 **** --- 310,314 ---- int *pLeafBrushes; BspBrush *pBrushes; + BspShader* pShaders; bool* pVisibleFaces; int* pMeshIndices; Index: physicnode.cc =================================================================== RCS file: /cvsroot/epfl/tgengine-0.1/physicnode.cc,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** physicnode.cc 15 Nov 2004 21:35:21 -0000 1.8 --- physicnode.cc 17 Nov 2004 22:43:06 -0000 1.9 *************** *** 19,22 **** --- 19,27 ---- } + PhysicNode::~PhysicNode() + { + vNodes.clear(); + } + void PhysicNode::UpdatePosition () { Index: physicengine.h =================================================================== RCS file: /cvsroot/epfl/tgengine-0.1/physicengine.h,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** physicengine.h 15 Nov 2004 21:35:21 -0000 1.7 --- physicengine.h 17 Nov 2004 22:43:06 -0000 1.8 *************** *** 15,18 **** --- 15,20 ---- Vector3 EndPoint; Vector3 Normal; + float Fraction; + bool AllSolid; //le node qui a ete touche. NULL si c'est la carte qui est touche ou si rien n'est touche PhysicNode* pNode; *************** *** 49,53 **** * @param PhysicNode le physicnode qui demande le trace -> le trace n'est pas bloqué par ce physicnode */ ! CollisionResult Trace(Vector3 Begin, Vector3 End, PhysicNode* edict=NULL); protected: void _TryToStep (PhysicNode*, float); --- 51,55 ---- * @param PhysicNode le physicnode qui demande le trace -> le trace n'est pas bloqué par ce physicnode */ ! CollisionResult Trace(Vector3 Begin, Vector3 End, Vector3 vMin=Vector3(0,0,0), Vector3 vMax=Vector3(0,0,0), PhysicNode* edict=NULL); protected: void _TryToStep (PhysicNode*, float); Index: scenemanager.h =================================================================== RCS file: /cvsroot/epfl/tgengine-0.1/scenemanager.h,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** scenemanager.h 13 Nov 2004 23:35:40 -0000 1.7 --- scenemanager.h 17 Nov 2004 22:43:06 -0000 1.8 *************** *** 19,23 **** struct DebugSphere { ! DebugSphere () { vPosition.Null(); fD = 10.0f; pColors[0] = pColors[1] = pColors[2] = pColors[3] = 1.0f; q = gluNewQuadric();} ~DebugSphere () { gluDeleteQuadric(q); } GLUquadric* q; --- 19,23 ---- struct DebugSphere { ! DebugSphere () { vPosition.Null(); fD = 5.0f; pColors[0] = pColors[1] = pColors[2] = pColors[3] = 1.0f; q = gluNewQuadric();} ~DebugSphere () { gluDeleteQuadric(q); } GLUquadric* q; Index: texture.cc =================================================================== RCS file: /cvsroot/epfl/tgengine-0.1/texture.cc,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** texture.cc 13 Nov 2004 23:35:40 -0000 1.10 --- texture.cc 17 Nov 2004 22:43:06 -0000 1.11 *************** *** 446,450 **** bool Texture::LoadJPG (char* image, texType type) { ! std::cout << "chargement de "<<image<<std::endl; SDL_Surface* texture; --- 446,450 ---- bool Texture::LoadJPG (char* image, texType type) { ! std::cout << "[TGE] Chargement de "<<image<<std::endl; SDL_Surface* texture; *************** *** 452,456 **** --- 452,459 ---- if (texture == NULL) + { + std::cerr << "[TGE] Impossible de charger le fichier " << image << std::endl; return false; + } FlipAroundX (texture->w, texture->h, (unsigned char*)texture->pixels); Index: decalmanager.h =================================================================== RCS file: /cvsroot/epfl/tgengine-0.1/decalmanager.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** decalmanager.h 13 Nov 2004 23:37:55 -0000 1.1 --- decalmanager.h 17 Nov 2004 22:43:06 -0000 1.2 *************** *** 8,11 **** --- 8,13 ---- #include "q3bsp.h" + #define NUM_MAX_DECALS 50 + namespace tg { *************** *** 15,19 **** public: DecalManager (); ! ~DecalManager () {} void AddDecal (Vector3 vPos, Vector3 vNorm, float sX, float sY, Texture* pTex, float t); void AddDecal (Decal* d); --- 17,21 ---- public: DecalManager (); ! ~DecalManager (); void AddDecal (Vector3 vPos, Vector3 vNorm, float sX, float sY, Texture* pTex, float t); void AddDecal (Decal* d); *************** *** 23,33 **** protected: ! void _ProcessTimedDecal (Decal* d, float t); ! void _RemoveDecal (Decal* d); Q3Bsp* pLevel; ! Decal* pFirstDecal; ! Decal* pCurrentDecal; --- 25,38 ---- protected: ! /*void _ProcessTimedDecal (Decal* d, float t); ! void _RemoveDecal (Decal* d);*/ ! ! Decal** pDecals; ! int iCurrentIndex; Q3Bsp* pLevel; ! /*Decal* pFirstDecal; ! Decal* pCurrentDecal;*/ Index: decalmanager.cc =================================================================== RCS file: /cvsroot/epfl/tgengine-0.1/decalmanager.cc,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** decalmanager.cc 13 Nov 2004 23:37:55 -0000 1.1 --- decalmanager.cc 17 Nov 2004 22:43:06 -0000 1.2 *************** *** 7,12 **** DecalManager::DecalManager () { ! pCurrentDecal = NULL; ! pFirstDecal = NULL; } --- 7,23 ---- DecalManager::DecalManager () { ! //pCurrentDecal = NULL; ! //pFirstDecal = NULL; ! pDecals = new Decal*[NUM_MAX_DECALS]; ! for (int i=0; i<NUM_MAX_DECALS; i++) ! pDecals[i] = NULL; ! iCurrentIndex = 0; ! } ! ! DecalManager::~DecalManager () ! { ! for (int i=0; i<NUM_MAX_DECALS; i++) ! if (pDecals[i] != NULL) ! delete pDecals[i]; } *************** *** 19,23 **** void DecalManager::AddDecal (Decal* d) { ! if (pFirstDecal) //le premier noeud existe { pCurrentDecal->SetNext(d); --- 30,41 ---- void DecalManager::AddDecal (Decal* d) { ! if ( iCurrentIndex >= NUM_MAX_DECALS ) //on doit supprimer le premier decal ! { ! delete pDecals[0]; ! iCurrentIndex = 0; ! } ! pDecals[iCurrentIndex] = d; ! iCurrentIndex++; ! /*if (pFirstDecal) //le premier noeud existe { pCurrentDecal->SetNext(d); *************** *** 32,41 **** pFirstDecal = d; pCurrentDecal = d; ! } } void DecalManager::Render (float eTime) { ! Decal* d = pFirstDecal; if (d != NULL) { --- 50,70 ---- pFirstDecal = d; pCurrentDecal = d; ! }*/ } void DecalManager::Render (float eTime) { ! glDepthMask(GL_FALSE); ! for (int i=0; i<NUM_MAX_DECALS; i++) ! { ! if (pDecals[i] == NULL) ! continue; ! if (pLevel->IsVisible(pLevel->FindLeaf(pDecals[i]->vPosition))) ! { ! Engine::pRenderer->RenderDecal(pDecals[i]); ! } ! } ! glDepthMask(GL_TRUE); ! /*Decal* d = pFirstDecal; if (d != NULL) { *************** *** 50,56 **** } while((d=d->GetNext()) != NULL); glDepthMask(GL_TRUE); ! } } ! void DecalManager::_ProcessTimedDecal(Decal* d, float t) { --- 79,85 ---- } while((d=d->GetNext()) != NULL); glDepthMask(GL_TRUE); ! }*/ } ! /* void DecalManager::_ProcessTimedDecal(Decal* d, float t) { *************** *** 95,99 **** } } ! } } --- 124,128 ---- } } ! }*/ } Index: q3bsp.cc =================================================================== RCS file: /cvsroot/epfl/tgengine-0.1/q3bsp.cc,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** q3bsp.cc 15 Nov 2004 21:35:21 -0000 1.13 --- q3bsp.cc 17 Nov 2004 22:43:06 -0000 1.14 *************** *** 237,240 **** --- 237,243 ---- numOfMeshIndices = lumps[kMeshVerts].length / sizeof(int); pMeshIndices = new int[numOfMeshIndices]; + //allocation memoire pour les effets + numOfShaders = lumps[kShaders].length / sizeof(BspShader); + pShaders = new BspShader[numOfShaders]; #ifdef DEBUG *************** *** 250,253 **** --- 253,257 ---- std::cout << "[TGE] nombre de brushsides:\t" << numOfBrushSides << std::endl; std::cout << "[TGE] nombre de meshindices:\t" << numOfMeshIndices << std::endl; + std::cout << "[TGE] nombre de shaders:\t" << numOfShaders << std::endl; #endif *************** *** 458,461 **** --- 462,474 ---- delete [] pLightMapsInfos; + //chargement des shaders + pFD.seekg(lumps[kShaders].offset); + pFD.read((char*)pShaders, sizeof(BspShader)*numOfShaders); + for (int i=0; i<numOfShaders; i++) + { + SWAPLONG(pShaders[i].brush); + SWAPLONG(pShaders[i].unknown); + } + //chargement des nodes pFD.seekg(lumps[kNodes].offset); *************** *** 601,605 **** { pFD.read(&buffer, sizeof(char)); ! if (buffer == '{') { //std::cout << "---nouvelle---" << std::endl; --- 614,619 ---- { pFD.read(&buffer, sizeof(char)); ! //std::cout << buffer ; ! /*if (buffer == '{') { //std::cout << "---nouvelle---" << std::endl; *************** *** 628,635 **** state=ENTITY_NAME; prop_value = name; ! //std::cout << "nom : " << prop_name << ",valeure : " << prop_value << std::endl; pEntities[eCount].mProperties[prop_name]=prop_value; } ! } } } --- 642,649 ---- state=ENTITY_NAME; prop_value = name; ! std::cout << "nom : " << prop_name << ",valeure : " << prop_value << std::endl; pEntities[eCount].mProperties[prop_name]=prop_value; } ! }*/ } } *************** *** 690,697 **** //std::string tex("textures/gothic_block/blocks15"); //strcat (pTexturesInfos[i].strName, ".bmp"); ! pMaterials[i].SetFirstTexture(pTexManager->LoadTexture(/*pTexturesInfos[i].strName*/("data/"+tex+".bmp").data(), TG_TEXTURE_2D)); ! pMaterials[i].SetNormalTexture(pTexManager->LoadTexture(("data/"+tex+"_local.bmp").data(), TG_TEXTURE_2D)); } - pSpotLight.SetFirstTexture(pTexManager->LoadTexture("spot.bmp", TG_TEXTURE_2D)); } --- 704,710 ---- //std::string tex("textures/gothic_block/blocks15"); //strcat (pTexturesInfos[i].strName, ".bmp"); ! pMaterials[i].SetFirstTexture(pTexManager->LoadTexture(/*pTexturesInfos[i].strName*/("data/"+tex+".jpg").data(), TG_TEXTURE_2D)); ! //pMaterials[i].SetNormalTexture(pTexManager->LoadTexture(("data/"+tex+"_local.jpg").data(), TG_TEXTURE_2D)); } } *************** *** 706,710 **** // Bind the texture to the texture arrays index and init the texture glBindTexture(GL_TEXTURE_2D, pLightMaps[i]); ! ChangeGamma((unsigned char*)pLightMapsInfos[i].imageBits, 128*128*3, 1); //ChangeContrast((unsigned char*)pLightMapsInfos[i].imageBits, 128*128*3, 3); // Build Mipmaps (builds different versions of the picture for distances - looks better) --- 719,723 ---- // Bind the texture to the texture arrays index and init the texture glBindTexture(GL_TEXTURE_2D, pLightMaps[i]); ! ChangeGamma((unsigned char*)pLightMapsInfos[i].imageBits, 128*128*3, 2); //ChangeContrast((unsigned char*)pLightMapsInfos[i].imageBits, 128*128*3, 3); // Build Mipmaps (builds different versions of the picture for distances - looks better) Index: boundingbox.cc =================================================================== RCS file: /cvsroot/epfl/tgengine-0.1/boundingbox.cc,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** boundingbox.cc 15 Nov 2004 21:35:21 -0000 1.7 --- boundingbox.cc 17 Nov 2004 22:43:06 -0000 1.8 *************** *** 208,214 **** Vector3 akPoint[2]; float extents[3]; ! extents[0] = (vMax.x-vMin.x); ! extents[1] = (vMax.y-vMin.y); ! extents[2] = (vMax.z-vMin.z); bool bIntersects = MgcFindIntersection(kOrigin,kDirection,extents, fT0,fT1); --- 208,217 ---- Vector3 akPoint[2]; float extents[3]; ! //extents[0] = (vMax.x-vMin.x); ! //extents[1] = (vMax.y-vMin.y); ! //extents[2] = (vMax.z-vMin.z); ! extents[0] = -vMin.x > vMax.x ? -vMin.x : vMax.x; ! extents[1] = -vMin.y > vMax.y ? -vMin.y : vMax.y; ! extents[2] = -vMin.z > vMax.z ? -vMin.z : vMax.z; bool bIntersects = MgcFindIntersection(kOrigin,kDirection,extents, fT0,fT1); Index: physicnode.h =================================================================== RCS file: /cvsroot/epfl/tgengine-0.1/physicnode.h,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** physicnode.h 15 Nov 2004 21:35:21 -0000 1.6 --- physicnode.h 17 Nov 2004 22:43:06 -0000 1.7 *************** *** 29,32 **** --- 29,34 ---- bool TraceRay(Vector3 begin, Vector3 end, Vector3& colPoint, Vector3& colNormal); + SceneNode* GetSceneNode (int i = 0) { return vNodes[i]; } + /** * Retourne un pointeur sur la classe servant de callback en cas de collision Index: physiccallback.h =================================================================== RCS file: /cvsroot/epfl/tgengine-0.1/physiccallback.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** physiccallback.h 12 Nov 2004 12:11:36 -0000 1.2 --- physiccallback.h 17 Nov 2004 22:43:06 -0000 1.3 *************** *** 10,19 **** */ ! class SceneNode; class PhysicCallBack { public: ! virtual void Collide (SceneNode* other,const Vector3& vPoint, const Vector3& vCollisionNormal) = 0; }; --- 10,19 ---- */ ! class PhysicNode; class PhysicCallBack { public: ! virtual void Collide (PhysicNode* other,const Vector3& vPoint, const Vector3& vCollisionNormal) = 0; }; |