Update of /cvsroot/epfl/tggame
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9682
Modified Files:
Makefile Makefile.Linux Makefile.LinuxVideo Makefile.OSX
actor.h aicontroller.cc aicontroller.h config.cfg
controller.cc controller.h dox_config game.cc game.h
gamedefs.h model.cc model.h pawn.cc pawn.h playercontroller.cc
playercontroller.h tg.cc world.cc world.h
Log Message:
force commit
Index: config.cfg
===================================================================
RCS file: /cvsroot/epfl/tggame/config.cfg,v
retrieving revision 1.8
retrieving revision 1.9
diff -C2 -d -r1.8 -r1.9
*** config.cfg 28 Oct 2004 21:20:33 -0000 1.8
--- config.cfg 12 Nov 2004 12:13:17 -0000 1.9
***************
*** 5,6 ****
--- 5,7 ----
-set lightpos.y 0
-set bump 0
+ -set gravity 1000
Index: world.h
===================================================================
RCS file: /cvsroot/epfl/tggame/world.h,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** world.h 21 Oct 2004 21:29:15 -0000 1.4
--- world.h 12 Nov 2004 12:13:17 -0000 1.5
***************
*** 23,26 ****
--- 23,29 ----
*/
World (char*);
+
+ int GetNumStartPositions ();
+ Vector3 GetStartPosition (int i);
/**
* ChangeMap : Change de map
Index: world.cc
===================================================================
RCS file: /cvsroot/epfl/tggame/world.cc,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** world.cc 1 Oct 2004 21:31:06 -0000 1.3
--- world.cc 12 Nov 2004 12:13:17 -0000 1.4
***************
*** 14,17 ****
--- 14,27 ----
}
+ int World::GetNumStartPositions ()
+ {
+ return pMap->GetNumStartPoints();
+ }
+
+ Vector3 World::GetStartPosition (int i)
+ {
+ return pStartPoints[i];
+ }
+
void World::_Load (char* mapName)
{
Index: game.cc
===================================================================
RCS file: /cvsroot/epfl/tggame/game.cc,v
retrieving revision 1.29
retrieving revision 1.30
diff -C2 -d -r1.29 -r1.30
*** game.cc 10 Nov 2004 21:02:19 -0000 1.29
--- game.cc 12 Nov 2004 12:13:17 -0000 1.30
***************
*** 118,122 ****
pModel->SetPosition(Vector3(5,0,-5));
pSceneManager->AddWorldObject(pModel);
!
//creation du joueur
Pawn* p = new Pawn();
--- 118,122 ----
pModel->SetPosition(Vector3(5,0,-5));
pSceneManager->AddWorldObject(pModel);
!
//creation du joueur
Pawn* p = new Pawn();
***************
*** 137,150 ****
//création d'un ennemi
! p = new Pawn();
! vPawns.push_back(p);
! this->AddPawn(p);
! Controller* c = new AIController(p);
! vControllers.push_back(c);
! p->SetMoveSpeed(CAM_SPEED);
! p->SetVelocity(Vector3(0,0,0));
! //p->SetRotation(Quaternion(-90, Vector3(1,0,0)));
! p->SetPosition(Vector3(0,70,0));
! c->SetViewOffset(Vector3(0,70,0));
//p->SetRotationVelocity(Quaternion(10,Vector3(0,1,1)));
--- 137,153 ----
//création d'un ennemi
! //for (int i=0; i<pWorld->GetNumStartPositions(); i++)
! //{
! p = new Pawn();
! vPawns.push_back(p);
! this->AddPawn(p);
! Controller* c = new AIController(p);
! vControllers.push_back(c);
! p->SetMoveSpeed(CAM_SPEED);
! p->SetVelocity(Vector3(0,0,0));
! //p->SetRotation(Quaternion(-90, Vector3(1,0,0)));
! p->SetPosition(pWorld->GetStartPosition(0));
! c->SetViewOffset(Vector3(0,70,0));
! //}
//p->SetRotationVelocity(Quaternion(10,Vector3(0,1,1)));
Index: controller.cc
===================================================================
RCS file: /cvsroot/epfl/tggame/controller.cc,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -d -r1.9 -r1.10
*** controller.cc 9 Nov 2004 18:19:03 -0000 1.9
--- controller.cc 12 Nov 2004 12:13:17 -0000 1.10
***************
*** 27,49 ****
vLastVel.Null();
- /*if (bDir[0]) {
- vLastVel.x = vVelocity.x += sinf(rot.y*DEGTORAD)*fSpeed;
- vLastVel.z = vVelocity.z -= cosf(rot.y*DEGTORAD)*fSpeed;
- }
-
- if (bDir[1]) {
- vLastVel.x = vVelocity.x -= sinf(rot.y*DEGTORAD)*fSpeed;
- vLastVel.z = vVelocity.z += cosf(rot.y*DEGTORAD)*fSpeed;
- }
-
- if (bDir[2]) {
- vLastVel.x = vVelocity.x -= cosf(rot.y*DEGTORAD)*fSpeed;
- vLastVel.z = vVelocity.z -= sinf(rot.y*DEGTORAD)*fSpeed;
- }
-
- if (bDir[3]) {
- vLastVel.x = vVelocity.x += cosf(rot.y*DEGTORAD)*fSpeed;
- vLastVel.z = vVelocity.z += sinf(rot.y*DEGTORAD)*fSpeed;
- }*/
Vector3 x, z;
//x = rot.Rotate(Vector3::UNIT_X);
--- 27,30 ----
***************
*** 51,54 ****
--- 32,38 ----
x = rot.GetXAxis();
z = rot.GetZAxis();
+ //le joueur ne peut pas choisir de se déplacer sur les y (vertical)
+ x.y = 0;
+ z.y = 0;
if (bDir[0])
vLastVel = vVelocity -= z*fSpeed;
Index: playercontroller.cc
===================================================================
RCS file: /cvsroot/epfl/tggame/playercontroller.cc,v
retrieving revision 1.13
retrieving revision 1.14
diff -C2 -d -r1.13 -r1.14
*** playercontroller.cc 10 Nov 2004 21:02:19 -0000 1.13
--- playercontroller.cc 12 Nov 2004 12:13:17 -0000 1.14
***************
*** 23,27 ****
Vector3 vTarget = pPawn->GetRotation().GetZAxis();
Vector3 vPosition = pPawn->GetPosition()+vViewOffset;
! vTarget = vPosition - vTarget*1000;
CollisionResult cR = Game::pSelf->Trace(vPosition, vTarget, pPawn);
--- 23,27 ----
Vector3 vTarget = pPawn->GetRotation().GetZAxis();
Vector3 vPosition = pPawn->GetPosition()+vViewOffset;
! vTarget = vPosition - vTarget*1000000;
CollisionResult cR = Game::pSelf->Trace(vPosition, vTarget, pPawn);
|