|
From: julien r. <jul...@us...> - 2004-10-24 16:56:29
|
Update of /cvsroot/epfl/tgengine-0.1 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22509 Modified Files: physicengine.cc scenemanager.cc scenenode.cc scenenode.h Log Message: Index: scenenode.cc =================================================================== RCS file: /cvsroot/epfl/tgengine-0.1/scenenode.cc,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** scenenode.cc 21 Oct 2004 21:18:28 -0000 1.5 --- scenenode.cc 24 Oct 2004 16:56:20 -0000 1.6 *************** *** 16,19 **** --- 16,20 ---- // bOnGround = false; bIsCamera = false; + bRender = true; // pPhysicCallBack = NULL; } *************** *** 33,36 **** --- 34,38 ---- // bOnGround = false; bIsCamera = false; + bRender = true; // pPhysicCallBack = NULL; } Index: physicengine.cc =================================================================== RCS file: /cvsroot/epfl/tgengine-0.1/physicengine.cc,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** physicengine.cc 24 Oct 2004 13:36:59 -0000 1.12 --- physicengine.cc 24 Oct 2004 16:56:20 -0000 1.13 *************** *** 26,30 **** trace.Fraction = 0.0f; ! while ((trace.Fraction < (1.0f - EPSILON)) || (bumpcount < MAXBUMPS)) //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 { --- 26,30 ---- trace.Fraction = 0.0f; ! while ((trace.Fraction < (1.0f - EPSILON)) && (bumpcount < MAXBUMPS)) //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 { *************** *** 47,51 **** time_left -= time_left*trace.Fraction; ClipVelocity (vVelocity, trace.CollisionNormal); ! } } --- 47,51 ---- time_left -= time_left*trace.Fraction; ClipVelocity (vVelocity, trace.CollisionNormal); ! bumpcount++; } } *************** *** 90,93 **** --- 90,98 ---- if (!n->Clip()) { + //ugly hack pour éviter de tomber quand on tappe noclip le jeu étant deja lancé (on se choppe l'accel négative de la frame précédente en fait... + Vector3 veloc = n->GetVelocity(); + veloc.y = 0; + n->SetVelocity(veloc); + n->SetPosition(n->GetPosition()+n->GetVelocity()*eTime); n->SetRotation(n->GetRotation()+n->GetRotationVelocity()*eTime); Index: scenemanager.cc =================================================================== RCS file: /cvsroot/epfl/tgengine-0.1/scenemanager.cc,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** scenemanager.cc 24 Oct 2004 13:36:59 -0000 1.9 --- scenemanager.cc 24 Oct 2004 16:56:20 -0000 1.10 *************** *** 89,97 **** { do ! { m->PreRender(frameInterval); m->GetBBox()->CalculatePlanes(); m->iLeaf = pLevel->FindLeaf(m->GetPosition()); ! if ((pLevel->IsVisible(m->iLeaf) || m->bCamera)) { --- 89,97 ---- { do ! { m->PreRender(frameInterval); m->GetBBox()->CalculatePlanes(); m->iLeaf = pLevel->FindLeaf(m->GetPosition()); ! if (m->GetRender() && ((pLevel->IsVisible(m->iLeaf) || m->bCamera))) { *************** *** 109,113 **** } ! m = pFirstObject; if (m != NULL) --- 109,113 ---- } ! /* m = pFirstObject; if (m != NULL) *************** *** 115,119 **** do { ! if (pLevel->IsVisible(m->iLeaf)) { Engine::pRenderer->RenderMeshShadow(m); --- 115,119 ---- do { ! if (m->GetRender() && pLevel->IsVisible(m->iLeaf)) { Engine::pRenderer->RenderMeshShadow(m); *************** *** 121,125 **** } while((m=m->GetNext()) != NULL); Engine::pRenderer->EndShadow(); ! } PointLight* pl = pFirstPointLight; --- 121,125 ---- } while((m=m->GetNext()) != NULL); Engine::pRenderer->EndShadow(); ! }*/ PointLight* pl = pFirstPointLight; Index: scenenode.h =================================================================== RCS file: /cvsroot/epfl/tgengine-0.1/scenenode.h,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** scenenode.h 24 Oct 2004 13:36:59 -0000 1.5 --- scenenode.h 24 Oct 2004 16:56:20 -0000 1.6 *************** *** 30,33 **** --- 30,36 ---- inline BoundingBox* GetBBox () { return pBBox; } + inline void SetRender(bool b) { bRender = b; } + inline bool GetRender () { return bRender; } + /* Position */ virtual void SetPosition (Vector3 v); *************** *** 59,63 **** protected: //PhysicCallBack* pPhysicCallBack; ! Vector3 vEuler; Vector3 vPosition; --- 62,66 ---- protected: //PhysicCallBack* pPhysicCallBack; ! bool bRender; Vector3 vEuler; Vector3 vPosition; |