ramp jump code

This commit is contained in:
Scott Brooks 2001-07-30 17:09:19 +00:00
parent 512a7008ab
commit d6c8711b50

View file

@ -202,7 +202,6 @@ void PM_ClipVelocity( vec3_t in, vec3_t normal, vec3_t out, float overbounce ) {
float backoff; float backoff;
float change; float change;
int i; int i;
backoff = DotProduct (in, normal); backoff = DotProduct (in, normal);
if ( backoff < 0 ) { if ( backoff < 0 ) {
@ -906,7 +905,18 @@ static void PM_WalkMove( void ) {
usercmd_t cmd; usercmd_t cmd;
float accelerate; float accelerate;
float vel; float vel;
//Blaze: New ramp move code
vec3_t point;
trace_t trace;
point[0] = pm->ps->origin[0];
point[1] = pm->ps->origin[1];
point[2] = pm->ps->origin[2] - 0.25;
pm->trace (&trace, pm->ps->origin, pm->mins, pm->maxs, point, pm->ps->clientNum, pm->tracemask);
//Com_Printf("(%f)",trace.plane.normal[2]);
//Blaze: end new ramp jump code
if ( pm->waterlevel > 2 && DotProduct( pml.forward, pml.groundTrace.plane.normal ) > 0 ) { if ( pm->waterlevel > 2 && DotProduct( pml.forward, pml.groundTrace.plane.normal ) > 0 ) {
// begin swimming // begin swimming
PM_WaterMove(); PM_WaterMove();
@ -965,6 +975,11 @@ static void PM_WalkMove( void ) {
wishspeed = VectorNormalize(wishdir); wishspeed = VectorNormalize(wishdir);
wishspeed *= scale; wishspeed *= scale;
//Blaze: Some ramp jump stuff here
wishspeed *= 2 - trace.plane.normal[2];
//End blaze ramp jumping stuff
// clamp the speed lower if ducking // clamp the speed lower if ducking
if ( pm->ps->pm_flags & PMF_DUCKED ) { if ( pm->ps->pm_flags & PMF_DUCKED ) {
if ( wishspeed > pm->ps->speed * pm_duckScale ) { if ( wishspeed > pm->ps->speed * pm_duckScale ) {