get the boxclipping debug code in semi-permanently (conditional, of course)

This commit is contained in:
Bill Currie 2010-08-05 02:52:56 +00:00 committed by Jeff Teunissen
parent ace5e7a702
commit 98cf61dfd6
3 changed files with 29 additions and 1 deletions

View file

@ -56,6 +56,10 @@ SV_CheckStuck (edict_t *ent)
int i, j, z;
vec3_t org;
#if ENABLE_BOXCLIP
return;
#endif
if (!SV_TestEntityPosition (ent)) {
VectorCopy (SVvector (ent, origin), SVvector (ent, oldorigin));
return;

View file

@ -237,14 +237,23 @@ SV_FlyMove (edict_t *ent, float time, trace_t *steptrace)
time_left = time;
for (bumpcount = 0; bumpcount < numbumps; bumpcount++) {
#if ENABLE_BOXCLIP
extern int dp;
#endif
if (VectorIsZero (SVvector (ent, velocity)))
break;
VectorMultAdd (SVvector (ent, origin), time_left,
SVvector (ent, velocity), end);
#if ENABLE_BOXCLIP
dp = 1;
#endif
trace = SV_Move (SVvector (ent, origin), SVvector (ent, mins),
SVvector (ent, maxs), end, false, ent);
#if ENABLE_BOXCLIP
dp = 0;
#endif
if (trace.allsolid) { // entity is trapped in another solid
VectorZero (SVvector (ent, velocity));

View file

@ -500,6 +500,9 @@ SV_TestEntityPosition (edict_t *ent)
return NULL;
}
#if ENABLE_BOXCLIP
int dp;
#endif
/*
SV_ClipMoveToEntity
@ -520,7 +523,7 @@ SV_ClipMoveToEntity (edict_t *touched, edict_t *mover, const vec3_t start,
trace.fraction = 1;
trace.allsolid = true;
trace.isbox = 0 ? true : false;//XXX box clipping test
trace.isbox = ENABLE_BOXCLIP ? true : false;//XXX box clipping test
VectorCopy (end, trace.endpos);
// get the clipping hull
@ -537,6 +540,18 @@ SV_ClipMoveToEntity (edict_t *touched, edict_t *mover, const vec3_t start,
if (trace.fraction != 1)
VectorAdd (trace.endpos, offset, trace.endpos);
#if ENABLE_BOXCLIP
if (dp)
printf ("(%g %g %g) -> (%g %g %g) => (%g %g %g)"
" %3g %d %d %d %d\n",
start_l[0], start_l[1], start_l[2],
end_l[0], end_l[1], end_l[2],
trace.endpos[0], trace.endpos[1], trace.endpos[2],
trace.fraction,
trace.allsolid, trace.startsolid,
trace.inopen, trace.inwater);
#endif
// did we clip the move?
if (trace.fraction < 1 || trace.startsolid)
trace.ent = touched;