mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2025-01-31 13:10:34 +00:00
Bail out when the trace advances past the nearest collision.
This commit is contained in:
parent
a943cdf2c4
commit
7a1faee460
1 changed files with 8 additions and 5 deletions
|
@ -57,6 +57,7 @@ static __attribute__ ((used)) const char rcsid[] =
|
||||||
typedef struct {
|
typedef struct {
|
||||||
vec3_t start;
|
vec3_t start;
|
||||||
vec3_t end;
|
vec3_t end;
|
||||||
|
vec_t start_frac;
|
||||||
int side;
|
int side;
|
||||||
int num;
|
int num;
|
||||||
mplane_t *plane;
|
mplane_t *plane;
|
||||||
|
@ -179,11 +180,12 @@ MOD_TraceLine (hull_t *hull, int num,
|
||||||
}
|
}
|
||||||
|
|
||||||
// pop up the stack for a back side
|
// pop up the stack for a back side
|
||||||
// FIXME detect early out from collisions
|
do {
|
||||||
if (tstack-- == tracestack) {
|
if (tstack-- == tracestack) {
|
||||||
// we've finished.
|
// we've finished.
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
} while (tstack->start_frac > trace->fraction);
|
||||||
|
|
||||||
// set the hit point for this plane
|
// set the hit point for this plane
|
||||||
VectorCopy (end, tstack->start);
|
VectorCopy (end, tstack->start);
|
||||||
|
@ -244,6 +246,7 @@ MOD_TraceLine (hull_t *hull, int num,
|
||||||
VectorSubtract (end, start, dist);
|
VectorSubtract (end, start, dist);
|
||||||
VectorMultAdd (start, frac[side], dist, end);
|
VectorMultAdd (start, frac[side], dist, end);
|
||||||
VectorMultAdd (start, frac[side ^ 1], dist, tstack->start);
|
VectorMultAdd (start, frac[side ^ 1], dist, tstack->start);
|
||||||
|
tstack->start_frac = frac[side ^ 1];
|
||||||
|
|
||||||
num = node->children[side];
|
num = node->children[side];
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue