things seem to be working nicely in point mode

This commit is contained in:
Bill Currie 2006-12-25 01:21:52 +00:00 committed by Jeff Teunissen
parent 9a7e4bc5e6
commit 24ab92e68d

View file

@ -42,6 +42,7 @@ static __attribute__ ((used)) const char rcsid[] =
#endif #endif
#include "QF/model.h" #include "QF/model.h"
#include "QF/sys.h"
#include "compat.h" #include "compat.h"
#include "world.h" #include "world.h"
@ -181,29 +182,21 @@ MOD_TraceLine (hull_t *hull, int num,
num = node->children[1]; num = node->children[1];
continue; continue;
} }
if (start_dist >= offset || start_dist <= -offset // when offset is 0, equvalent to (start_dist >= 0 && end_dist < 0) and
|| end_dist >= offset || end_dist <= -offset) { // (start_dist < 0 && end_dist >= 0) due to the above tests.
// either: if (start_dist >= offset && end_dist <= -offset) {
// end_dist is guaranteed to be < offset or > -offset side = 0;
// or: frac = (start_dist - offset) / (start_dist - end_dist);
// start_dist is guaranteed to be < offset or > -offset } else if (start_dist <= offset && end_dist >= offset) {
// so splitting is needed, on the offset plane closest to side = 1;
// start frac = (start_dist + offset) / (start_dist - end_dist);
side = start_dist < 0;
if (start_dist < 0) {
frac = (start_dist + offset) / (start_dist - end_dist);
} else {
frac = (start_dist - offset) / (start_dist - end_dist);
}
frac = bound (0, frac, 1);
} else { } else {
// both: // get here only when offset is non-zero
// start_dist is guaranteed to be < offset and > -offset Sys_Printf ("foo\n");
// and:
// end_dist is guaranteed to be < offset and > -offset
frac = 1; frac = 1;
side = start_dist < end_dist; side = start_dist < end_dist;
} }
frac = bound (0, frac, 1);
tstack->num = num; tstack->num = num;
tstack->side = side; tstack->side = side;