From: Keith F. <ven...@us...> - 2003-03-06 01:01:33
|
Update of /cvsroot/planeshift/planeshift/src/common/psprop/imp In directory sc8-pr-cvs1:/tmp/cvs-serv17202 Modified Files: pslinmove.cpp Log Message: Clamped downward velocity and shortened CD interval. Index: pslinmove.cpp =================================================================== RCS file: /cvsroot/planeshift/planeshift/src/common/psprop/imp/pslinmove.cpp,v retrieving revision 1.68 retrieving revision 1.69 diff -C2 -d -r1.68 -r1.69 *** pslinmove.cpp 3 Mar 2003 04:21:10 -0000 1.68 --- pslinmove.cpp 6 Mar 2003 01:01:27 -0000 1.69 *************** *** 220,224 **** } ! #ifndef min(a,b) #define min(a,b) (((a)<(b))?(a):(b)) #define max(a,b) (((a)>(b))?(a):(b)) --- 220,224 ---- } ! #ifndef min #define min(a,b) (((a)<(b))?(a):(b)) #define max(a,b) (((a)>(b))?(a):(b)) *************** *** 265,269 **** } ! #define MAX_CD_INTERVAL 0.1 bool celPcLinearMovement::MoveSprite(float delta) --- 265,270 ---- } ! #define MAX_CD_INTERVAL 0.05 ! #define MAX_MOVING_LAG 0.5 bool celPcLinearMovement::MoveSprite(float delta) *************** *** 272,275 **** --- 273,280 ---- if (useCD) { + if (delta > MAX_MOVING_LAG) + { + vel.Set(0,0,0); + } while (delta > MAX_CD_INTERVAL) { *************** *** 288,291 **** --- 293,298 ---- + #define MAX_GRAV_VELOCITY 4 + //Does the actual move bool celPcLinearMovement::MoveV (float delta) *************** *** 385,389 **** onground = false; // gravity! move down! ! celPcLinearMovement::vel.y -= 0.5 * delta; } else --- 392,399 ---- onground = false; // gravity! move down! ! celPcLinearMovement::vel.y -= 0.5 * delta; ! // clamp value on long jumps or lagginess ! if (celPcLinearMovement::vel.y < -MAX_GRAV_VELOCITY) ! celPcLinearMovement::vel.y = -MAX_GRAV_VELOCITY; } else |