From: Matze B. <mat...@us...> - 2002-02-26 22:02:03
|
Update of /cvsroot/planeshift/planeshift/src/common/psbehave In directory usw-pr-cvs1:/tmp/cvs-serv15863/src/common/psbehave Modified Files: psbehave.cpp psbehave.h Log Message: - added acraigs new cel follow camera mode to client and changed behaviour for it - place players at the defined startpoints in the maps Index: psbehave.cpp =================================================================== RCS file: /cvsroot/planeshift/planeshift/src/common/psbehave/psbehave.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** psbehave.cpp 18 Feb 2002 22:07:20 -0000 1.3 --- psbehave.cpp 26 Feb 2002 22:01:59 -0000 1.4 *************** *** 3,6 **** --- 3,9 ---- #include <iutil/objreg.h> + #include <iengine/mesh.h> + #include <iengine/movable.h> + #include <iengine/camera.h> #include <csutil/util.h> #include <csgeom/vector3.h> *************** *** 10,13 **** --- 13,17 ---- #include <pf/gravity.h> #include <pf/camera.h> + #include <pf/mesh.h> #include "psbehave.h" *************** *** 99,102 **** --- 103,110 ---- if (!pcgravity) return false; + iPcMesh* pcmesh = CEL_QUERY_PROPCLASS + (entity->GetPropertyClassList(), iPcMesh); + if (!pcmesh) + return false; if (!strcmp (msg_id+11, "forward1")) *************** *** 120,124 **** else if (!strcmp (msg_id+11, "strafeleft1")) { ! pcgravity->ApplyForce(csVector3(-1*speed,0,0), 100000); } else if (!strcmp (msg_id+11, "strafeleft0")) --- 128,132 ---- else if (!strcmp (msg_id+11, "strafeleft1")) { ! pcgravity->ApplyForce(csVector3(1*speed,0,0), 100000); } else if (!strcmp (msg_id+11, "strafeleft0")) *************** *** 129,133 **** else if (!strcmp (msg_id+11, "straferight1")) { ! pcgravity->ApplyForce(csVector3(1*speed,0,0), 100000); } else if (!strcmp (msg_id+11, "straferight0")) --- 137,141 ---- else if (!strcmp (msg_id+11, "straferight1")) { ! pcgravity->ApplyForce(csVector3(-1*speed,0,0), 100000); } else if (!strcmp (msg_id+11, "straferight0")) *************** *** 136,139 **** --- 144,157 ---- pcgravity->ClearForces(); } + else if (!strcmp (msg_id+11, "rotateright1")) + { + pcmesh->GetMesh()->GetMovable()->GetTransform().RotateThis + (CS_VEC_ROT_RIGHT, 0.5); + } + else if (!strcmp (msg_id+11, "rotateleft1")) + { + pcmesh->GetMesh()->GetMovable()->GetTransform().RotateThis + (CS_VEC_ROT_LEFT, 0.5); + } else if (!strcmp (msg_id+11, "run1")) { *************** *** 159,162 **** --- 177,181 ---- printf ("Switching to 3rd person view!\n"); pccam->SetMode (iPcCamera::follow, true); + pccam->SetFollowPos (csVector3(0,2,2), csVector3(0,0.7,0)); } else *************** *** 166,169 **** --- 185,189 ---- } pccam->DecRef(); + pcmesh->DecRef(); } pcgravity->DecRef (); Index: psbehave.h =================================================================== RCS file: /cvsroot/planeshift/planeshift/src/common/psbehave/psbehave.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** psbehave.h 12 Feb 2002 11:24:12 -0000 1.2 --- psbehave.h 26 Feb 2002 22:01:59 -0000 1.3 *************** *** 65,69 **** protected: float speed; ! int fpscam; }; --- 65,69 ---- protected: float speed; ! int fpscam; }; |