Add a new (failing) test case.

This one demonstrates the need for more information in the bsp tree
(surface polygons). When the box collides with a corner where one side is
flat and the other angled, but there's a partition plane cutting the two,
the box can instead collide with the angled side before it hits the corner.
This commit is contained in:
Bill Currie 2011-11-14 09:26:31 +09:00
parent 7a1faee460
commit 2f23cfa4d0

View file

@ -232,6 +232,33 @@ hull_t hull_covered_step = {
{0, 0, 0},
};
// 0
// eee|eee
// eee+--- 1
// ee/0,0s
// 2 ssss
mclipnode_t clipnodes_ramp[] = {
{ 0, { 1, 2}},
{ 1, {CONTENTS_EMPTY, CONTENTS_SOLID}},
{ 2, {CONTENTS_EMPTY, CONTENTS_SOLID}},
};
mplane_t planes_ramp[] = {
{{ 1, 0, 0}, 0, 0, 0},
{{ 0, 0, 1}, 0, 2, 0},
{{-0.6, 0, 0.8}, 0, 4, 0},
};
hull_t hull_ramp = {
clipnodes_ramp,
planes_ramp,
0,
2,
{0, 0, 0},
{0, 0, 0},
};
typedef struct {
vec3_t extents;
} box_t;
@ -324,6 +351,9 @@ test_t tests[] = {
{ 0, 0, 64}, {0, 0, 0}, { 0.375, 0, 0, 1, 0}},
{"Box, Step 3", &box, &hull_step3,
{ 0, 0, 64}, {0, 0, 0}, { 0.375, 0, 0, 1, 0}},
{"Box, Ramp", &box, &hull_ramp,
{ 0, 0, 16}, {0, 0, 0}, { 0.5, 0, 0, 1, 0}},
};
#define num_tests (sizeof (tests) / sizeof (tests[0]))