|
From: julien r. <jul...@us...> - 2004-12-05 14:30:08
|
Update of /cvsroot/epfl/tggame In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21677 Modified Files: game.cc playercontroller.cc rocket.cc rocketlauncher.cc rocketlauncher.h Log Message: cf wiki&phorum Index: game.cc =================================================================== RCS file: /cvsroot/epfl/tggame/game.cc,v retrieving revision 1.42 retrieving revision 1.43 diff -C2 -d -r1.42 -r1.43 *** game.cc 2 Dec 2004 00:18:54 -0000 1.42 --- game.cc 5 Dec 2004 14:29:55 -0000 1.43 *************** *** 86,91 **** void Game::_CreatePlayers () { ! pEngine->pMeshManager->Load("guardian", "data/models/guardian/guardian.md5mesh"); ! pEngine->pMeshManager->LoadAnim("guardian", "data/models/guardian/death.md5anim"); pEngine->pMeshManager->Load("machinegun", "data/models/machinegun/viewmachinegun.md5mesh"); pEngine->pMeshManager->LoadAnim("machinegun", "data/models/machinegun/idle.md5anim"); --- 86,91 ---- void Game::_CreatePlayers () { ! pEngine->pMeshManager->Load("guardian", "data/models/buggy/buggy.md5mesh"); ! pEngine->pMeshManager->LoadAnim("guardian", "data/models/buggy/buggy.md5anim"); pEngine->pMeshManager->Load("machinegun", "data/models/machinegun/viewmachinegun.md5mesh"); pEngine->pMeshManager->LoadAnim("machinegun", "data/models/machinegun/idle.md5anim"); *************** *** 137,141 **** p->SetVelocity(Vector3(0,0,0)); //p->SetRotation(Quaternion(-90, Vector3::UNIT_X)); - p->SetPosition(pWorld->GetStartPosition(0)); p->SetPosition (Vector3(-80,80,100)); p->SetBB(Vector3(-15, 0, -15), Vector3(15, 80, 15)); --- 137,140 ---- *************** *** 143,146 **** --- 142,151 ---- //} + p = new Pawn("guardian"); + p->SetAnimation("death"); + this->AddPawn(p); + p->SetPosition(pWorld->GetStartPosition(0)); + p->SetBB(Vector3(-50, 0, -50), Vector3(50, 200, 50)); + //p->SetRotationVelocity(Quaternion(10,Vector3(0,1,1))); //p->SetRotation(Quaternion(90,Vector3(0,1,0))); Index: rocketlauncher.cc =================================================================== RCS file: /cvsroot/epfl/tggame/rocketlauncher.cc,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** rocketlauncher.cc 30 Nov 2004 18:22:01 -0000 1.5 --- rocketlauncher.cc 5 Dec 2004 14:29:55 -0000 1.6 *************** *** 6,10 **** fFireRate = 0.1f; fCoolDown = fFireRate; - pLast = NULL; } --- 6,9 ---- *************** *** 20,31 **** fCoolDown = fFireRate; - Vector3 target = vPosition - vTarget*10000; ! Rocket* pRocket = new Rocket (this, vPosition, target); ! //FIXME: Ca plante si on l'ajoute au physicengine Game::pSelf->AddPawn(pRocket, true, true); - pLast = pRocket; - SoundManager::pSoundManager->PlaySound("fire"); --- 19,26 ---- fCoolDown = fFireRate; ! Rocket* pRocket = new Rocket (this, vPosition, vTarget); Game::pSelf->AddPawn(pRocket, true, true); SoundManager::pSoundManager->PlaySound("fire"); *************** *** 34,42 **** void RocketLauncher::AltFire (const Vector3& vPosition, const Vector3& vTarget, Pawn* p) { - if (pLast == NULL) - return; - Game::pSelf->RemovePawn(pLast); - delete pLast; - pLast = NULL; } --- 29,32 ---- Index: rocketlauncher.h =================================================================== RCS file: /cvsroot/epfl/tggame/rocketlauncher.h,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** rocketlauncher.h 30 Nov 2004 18:22:01 -0000 1.3 --- rocketlauncher.h 5 Dec 2004 14:29:55 -0000 1.4 *************** *** 17,21 **** protected: - Rocket* pLast; }; --- 17,20 ---- Index: playercontroller.cc =================================================================== RCS file: /cvsroot/epfl/tggame/playercontroller.cc,v retrieving revision 1.24 retrieving revision 1.25 diff -C2 -d -r1.24 -r1.25 *** playercontroller.cc 2 Dec 2004 00:18:54 -0000 1.24 --- playercontroller.cc 5 Dec 2004 14:29:55 -0000 1.25 *************** *** 28,48 **** pWeapon->Think(eTime); //Test des tirs ! Vector3 vTarget; ! Vector3 vPosition; if (bFire) { ! vTarget = pPawn->GetRotation().GetZAxis(); ! vPosition = pPawn->GetPosition()+vViewOffset-vTarget*50; pWeapon->Fire (vPosition, vTarget, pPawn); } if (bAltFire) { - vTarget = pPawn->GetRotation().GetZAxis(); - vPosition = pPawn->GetPosition()+vViewOffset-vTarget*50; pWeapon->AltFire (vPosition, vTarget, pPawn); } - vPosition = pPawn->GetPosition()+vViewOffset; - vTarget = vPosition - pPawn->GetRotation().GetZAxis()*1000000; CollisionResult cR = Game::pSelf->Trace(vPosition, vTarget, pPawn); --- 28,44 ---- pWeapon->Think(eTime); //Test des tirs ! Vector3 vPosition = pPawn->GetPosition()+vViewOffset; ! ! Vector3 vTarget = vPosition - pPawn->GetRotation().GetZAxis()*1000000; if (bFire) { ! pWeapon->Fire (vPosition, vTarget, pPawn); } if (bAltFire) { pWeapon->AltFire (vPosition, vTarget, pPawn); } CollisionResult cR = Game::pSelf->Trace(vPosition, vTarget, pPawn); Index: rocket.cc =================================================================== RCS file: /cvsroot/epfl/tggame/rocket.cc,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** rocket.cc 2 Dec 2004 00:18:54 -0000 1.8 --- rocket.cc 5 Dec 2004 14:29:55 -0000 1.9 *************** *** 9,14 **** Rocket::Rocket (Weapon* handler, const Vector3& vPosition, const Vector3& vTarget) : Projectile (handler, "rocket") { - pPhysic->SetGravityFactor(0.0f); pPhysic->SetPosition(vPosition); Vector3 vVeloc = (vTarget-vPosition).Normalize(); vVeloc *= fSpeed; --- 9,15 ---- Rocket::Rocket (Weapon* handler, const Vector3& vPosition, const Vector3& vTarget) : Projectile (handler, "rocket") { pPhysic->SetPosition(vPosition); + pPhysic->SetPhysicType(PHYS_PROJECTILE); + Vector3 vVeloc = (vTarget-vPosition).Normalize(); vVeloc *= fSpeed; |