Update of /cvsroot/epfl/tggame
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14520
Modified Files:
config.cfg game.cc game.h pawn.cc pawn.h playercontroller.cc
playercontroller.h tg.cc
Log Message:
Index: config.cfg
===================================================================
RCS file: /cvsroot/epfl/tggame/config.cfg,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** config.cfg 21 Oct 2004 21:29:15 -0000 1.6
--- config.cfg 25 Oct 2004 20:04:14 -0000 1.7
***************
*** 5,6 ****
--- 5,7 ----
-set lightpos.y 0
-set bump 0
+ -clip
Index: game.cc
===================================================================
RCS file: /cvsroot/epfl/tggame/game.cc,v
retrieving revision 1.19
retrieving revision 1.20
diff -C2 -d -r1.19 -r1.20
*** game.cc 24 Oct 2004 14:53:58 -0000 1.19
--- game.cc 25 Oct 2004 20:04:14 -0000 1.20
***************
*** 5,8 ****
--- 5,9 ----
Game::Game (int argc, char** argv)
{
+ pSelf = this;
//Initialisation de base
pTimer = new Timer ();
***************
*** 114,117 ****
--- 115,119 ----
p->GetBBox()->vMax = Vector3(10,10,10);
p->SetMoveSpeed (CAM_SPEED);
+ p->SetVisible(false);
//p->GetCamera()->SetPhysicCallBack(pLocalController);
***************
*** 133,137 ****
p->SetVelocity(Vector3(0,0,0));
p->SetPosition(Vector3(50,70,0));
! p->SetRotationVelocity(Vector3(10,10,0));
//p->SetPosition(pWorld->GetRandomStartPosition()+Vector3(0,30,0));
//p->GetModel()->SetPhysicCallBack(c);
--- 135,139 ----
p->SetVelocity(Vector3(0,0,0));
p->SetPosition(Vector3(50,70,0));
! p->SetRotationVelocity(Vector3(10,0,10));
//p->SetPosition(pWorld->GetRandomStartPosition()+Vector3(0,30,0));
//p->GetModel()->SetPhysicCallBack(c);
Index: pawn.cc
===================================================================
RCS file: /cvsroot/epfl/tggame/pawn.cc,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** pawn.cc 24 Oct 2004 14:53:58 -0000 1.5
--- pawn.cc 25 Oct 2004 20:04:14 -0000 1.6
***************
*** 9,13 ****
pModel = Engine::pMeshManager->Load("data/models/pinky/pinky.md5mesh");
pPhysic = new PhysicNode(pModel);
- pPhysic->SetClip(true);
fMoveSpeed = 0.0f;
}
--- 9,12 ----
Index: pawn.h
===================================================================
RCS file: /cvsroot/epfl/tggame/pawn.h,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** pawn.h 24 Oct 2004 14:53:58 -0000 1.6
--- pawn.h 25 Oct 2004 20:04:14 -0000 1.7
***************
*** 52,55 ****
--- 52,60 ----
void Add(PhysicEngine* p) {p->AddNode(pPhysic); }
void Add(SceneManager* s) {s->AddWorldObject(pModel); }
+
+ inline void SetClip(bool b) { pPhysic->SetClip(b); }
+ inline bool GetClip () { return pPhysic->Clip(); }
+
+ inline void SetVisible (bool b) { pModel->SetRender(b); }
//Model* GetModel () { return pModel; }
Index: playercontroller.h
===================================================================
RCS file: /cvsroot/epfl/tggame/playercontroller.h,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** playercontroller.h 10 Oct 2004 20:54:47 -0000 1.3
--- playercontroller.h 25 Oct 2004 20:04:14 -0000 1.4
***************
*** 8,13 ****
using namespace tg;
! class PlayerController : public Controller
{
public:
PlayerController (Pawn*);
--- 8,17 ----
using namespace tg;
! class PlayerController : public Controller, public Function
{
+ enum {
+ CLIP=1
+ };
+
public:
PlayerController (Pawn*);
***************
*** 15,18 ****
--- 19,29 ----
void EventHandler (tgEvent& e);
void Collide(SceneNode* other, const Vector3& vPoint, const Vector3& vCollisionNormal);
+
+ void Exec (const std::string& s, int arg) {
+ switch(arg) {
+ case CLIP: pPawn->SetClip(pPawn->GetClip() ? false:true); break;
+ default: break;
+ }
+ }
};
Index: playercontroller.cc
===================================================================
RCS file: /cvsroot/epfl/tggame/playercontroller.cc,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -d -r1.7 -r1.8
*** playercontroller.cc 24 Oct 2004 14:53:58 -0000 1.7
--- playercontroller.cc 25 Oct 2004 20:04:14 -0000 1.8
***************
*** 7,11 ****
PlayerController::PlayerController(Pawn* p) : Controller (p)
{
!
}
--- 7,11 ----
PlayerController::PlayerController(Pawn* p) : Controller (p)
{
! Game::pSelf->GetConsole()->Register("clip", this, CLIP);
}
Index: tg.cc
===================================================================
RCS file: /cvsroot/epfl/tggame/tg.cc,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -C2 -d -r1.1.1.1 -r1.2
*** tg.cc 23 Sep 2004 22:57:24 -0000 1.1.1.1
--- tg.cc 25 Oct 2004 20:04:14 -0000 1.2
***************
*** 4,8 ****
{
Game* pGame = new Game(argc, argv);
- pGame->pSelf = pGame;
pGame->MainLoop ();
};
--- 4,7 ----
Index: game.h
===================================================================
RCS file: /cvsroot/epfl/tggame/game.h,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -d -r1.7 -r1.8
*** game.h 24 Oct 2004 14:53:58 -0000 1.7
--- game.h 25 Oct 2004 20:04:14 -0000 1.8
***************
*** 56,59 ****
--- 56,60 ----
inline World* GetWorld () { return pWorld; }
inline Engine* GetEngine () { return pEngine; }
+ inline Console* GetConsole () { return pConsole; }
/**
|