mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2024-11-23 04:42:32 +00:00
Correct the sign for the shift in frac.
However, this is not entirely correct as the new start point when testing the other side of the plane also needs to be calculated.
This commit is contained in:
parent
b82d9f5894
commit
fa6390a46a
2 changed files with 7 additions and 2 deletions
|
@ -212,6 +212,11 @@ test_t tests[] = {
|
||||||
{ -16, 0, 8}, {16, 0, 24}, { 0.25, 0, 0, 1, 0}},
|
{ -16, 0, 8}, {16, 0, 24}, { 0.25, 0, 0, 1, 0}},
|
||||||
{"Box, Step 1", &box, &hull_step1,
|
{"Box, Step 1", &box, &hull_step1,
|
||||||
{ -16, 0, 8}, {16, 0, 40}, { 0.25, 0, 0, 1, 0}},
|
{ -16, 0, 8}, {16, 0, 40}, { 0.25, 0, 0, 1, 0}},
|
||||||
|
{"Box, Step 1", &box, &hull_step1,
|
||||||
|
{ -16, 0, 8}, {16, 0, 135}, { 0.25, 0, 0, 1, 0}},
|
||||||
|
// 136 is a corner case caused by back/front side issues and 0
|
||||||
|
{"Box, Step 1", &box, &hull_step1,
|
||||||
|
{ -16, 0, 8}, {16, 0, 137}, { 1, 0, 0, 1, 0}},
|
||||||
};
|
};
|
||||||
#define num_tests (sizeof (tests) / sizeof (tests[0]))
|
#define num_tests (sizeof (tests) / sizeof (tests[0]))
|
||||||
|
|
||||||
|
|
|
@ -209,9 +209,9 @@ MOD_TraceLine (hull_t *hull, int num,
|
||||||
|
|
||||||
side = start_dist < 0;
|
side = start_dist < 0;
|
||||||
if (side)
|
if (side)
|
||||||
frac = (start_dist + offset) / (start_dist - end_dist);
|
|
||||||
else
|
|
||||||
frac = (start_dist - offset) / (start_dist - end_dist);
|
frac = (start_dist - offset) / (start_dist - end_dist);
|
||||||
|
else
|
||||||
|
frac = (start_dist + offset) / (start_dist - end_dist);
|
||||||
frac = bound (0, frac, 1);
|
frac = bound (0, frac, 1);
|
||||||
|
|
||||||
tstack->num = num;
|
tstack->num = num;
|
||||||
|
|
Loading…
Reference in a new issue