testqbsp: add q1_clip_func_wall

Ensure submodels that are all "clip" get bounds set correctly
This commit is contained in:
Eric Wasylishen 2022-06-30 00:53:02 -06:00
parent 2127209955
commit 862d9bd5f2
2 changed files with 105 additions and 0 deletions

View File

@ -1003,6 +1003,32 @@ TEST_CASE("q1_cube", "[testmaps_q1]")
CHECK(cube_bounds.grow(-1).maxs() == bsp.dmodels[0].maxs);
}
/**
* Ensure submodels that are all "clip" get bounds set correctly
*/
TEST_CASE("q1_clip_func_wall", "[testmaps_q1]")
{
const auto [bsp, bspx, prt] = LoadTestmapQ1("qbsp_q1_clip_func_wall.map");
REQUIRE(prt.has_value());
const aabb3d cube_bounds {
{64, 64, 48},
{128, 128, 80}
};
REQUIRE(2 == bsp.dmodels.size());
// node bounds
auto &headnode = bsp.dnodes[bsp.dmodels[1].headnode[0]];
CHECK(cube_bounds.grow(24).mins() == headnode.mins);
CHECK(cube_bounds.grow(24).maxs() == headnode.maxs);
// model bounds are shrunk by 1 unit on each side for some reason
CHECK(cube_bounds.grow(-1).mins() == bsp.dmodels[1].mins);
CHECK(cube_bounds.grow(-1).maxs() == bsp.dmodels[1].maxs);
}
/**
* Lots of features in one map, more for testing in game than automated testing
*/

View File

@ -0,0 +1,79 @@
// Game: Quake
// Format: Standard
// entity 0
{
"classname" "worldspawn"
"wad" "deprecated/free_wad.wad"
// brush 0
{
( -304 32 16 ) ( -304 256 16 ) ( -304 32 192 ) bolt9 0 0 0 1 1
( -304 32 192 ) ( -288 32 192 ) ( -304 32 16 ) bolt9 0 0 0 1 1
( -304 32 16 ) ( -288 32 16 ) ( -304 256 16 ) bolt9 0 0 0 1 1
( -304 256 192 ) ( -288 256 192 ) ( -304 32 192 ) bolt9 0 0 0 1 1
( -304 256 16 ) ( -288 256 16 ) ( -304 256 192 ) bolt9 0 0 0 1 1
( -288 32 16 ) ( -288 32 192 ) ( -288 256 16 ) bolt9 0 0 0 1 1
}
// brush 1
{
( -288 256 192 ) ( -288 240 192 ) ( -288 256 16 ) bolt9 0 0 0 1 1
( -64 240 192 ) ( -64 240 16 ) ( -288 240 192 ) bolt9 0 0 0 1 1
( -288 256 16 ) ( -288 240 16 ) ( -64 256 16 ) bolt9 0 0 0 1 1
( -64 256 192 ) ( -64 240 192 ) ( -288 256 192 ) bolt9 0 0 0 1 1
( -64 256 192 ) ( -288 256 192 ) ( -64 256 16 ) bolt9 0 0 0 1 1
( 224 256 16 ) ( 224 240 16 ) ( 224 256 192 ) bolt9 0 0 0 1 1
}
// brush 2
{
( -288 32 16 ) ( -288 48 16 ) ( -288 32 192 ) bolt9 0 0 0 1 1
( -64 32 16 ) ( -288 32 16 ) ( -64 32 192 ) bolt9 0 0 0 1 1
( -64 32 16 ) ( -64 48 16 ) ( -288 32 16 ) bolt9 0 0 0 1 1
( -288 32 192 ) ( -288 48 192 ) ( -64 32 192 ) bolt9 0 0 0 1 1
( -288 48 16 ) ( -64 48 16 ) ( -288 48 192 ) bolt9 0 0 0 1 1
( 224 32 192 ) ( 224 48 192 ) ( 224 32 16 ) bolt9 0 0 0 1 1
}
// brush 3
{
( -288 48 192 ) ( -288 48 176 ) ( -288 240 192 ) bolt9 0 0 0 1 1
( -64 48 192 ) ( -64 48 176 ) ( -288 48 192 ) bolt9 0 0 0 1 1
( -64 240 176 ) ( -288 240 176 ) ( -64 48 176 ) bolt9 0 0 0 1 1
( -64 240 192 ) ( -64 48 192 ) ( -288 240 192 ) bolt9 0 0 0 1 1
( -288 240 192 ) ( -288 240 176 ) ( -64 240 192 ) bolt9 0 0 0 1 1
( 224 240 192 ) ( 224 240 176 ) ( 224 48 192 ) bolt9 0 0 0 1 1
}
// brush 4
{
( -288 240 16 ) ( -288 240 32 ) ( -288 48 16 ) bolt9 0 0 0 1 1
( -288 48 16 ) ( -288 48 32 ) ( -64 48 16 ) bolt9 0 0 0 1 1
( -288 240 16 ) ( -288 48 16 ) ( -64 240 16 ) bolt9 0 0 0 1 1
( -288 48 32 ) ( -288 240 32 ) ( -64 48 32 ) bolt9 0 0 0 1 1
( -64 240 16 ) ( -64 240 32 ) ( -288 240 16 ) bolt9 0 0 0 1 1
( 224 48 16 ) ( 224 48 32 ) ( 224 240 16 ) bolt9 0 0 0 1 1
}
// brush 5
{
( 208 48 32 ) ( 208 49 32 ) ( 208 48 33 ) bolt9 0 0 0 1 1
( 208 48 32 ) ( 208 48 33 ) ( 209 48 32 ) bolt9 0 0 0 1 1
( 208 48 32 ) ( 209 48 32 ) ( 208 49 32 ) bolt9 0 0 0 1 1
( 224 240 192 ) ( 224 241 192 ) ( 225 240 192 ) bolt9 0 0 0 1 1
( 224 240 40 ) ( 225 240 40 ) ( 224 240 41 ) bolt9 0 0 0 1 1
( 224 240 40 ) ( 224 240 41 ) ( 224 241 40 ) bolt9 0 0 0 1 1
}
}
// entity 1
{
"classname" "info_player_start"
"origin" "-240 80 56"
}
// entity 2
{
"classname" "func_wall"
// brush 0
{
( 64 64 48 ) ( 64 65 48 ) ( 64 64 49 ) clip 0 0 0 1 1
( 64 64 48 ) ( 64 64 49 ) ( 65 64 48 ) clip 0 0 0 1 1
( 64 64 48 ) ( 65 64 48 ) ( 64 65 48 ) clip 0 0 0 1 1
( 128 128 80 ) ( 128 129 80 ) ( 129 128 80 ) clip 0 0 0 1 1
( 128 128 64 ) ( 129 128 64 ) ( 128 128 65 ) clip 0 0 0 1 1
( 128 128 64 ) ( 128 128 65 ) ( 128 129 64 ) clip 0 0 0 1 1
}
}