qbsp: fix model bounds

This commit is contained in:
Eric Wasylishen 2022-06-22 22:23:14 -06:00
parent 84263ef1a1
commit af802d5447
2 changed files with 4 additions and 4 deletions

View File

@ -930,7 +930,7 @@ tree_t *BrushBSP(mapentity_t *entity, bool midsplit)
* smarter, but this works. * smarter, but this works.
*/ */
node_t *headnode = new node_t{}; node_t *headnode = new node_t{};
headnode->bounds = entity->bounds.grow(SIDESPACE); headnode->bounds = entity->bounds;
headnode->children[0] = new node_t{}; headnode->children[0] = new node_t{};
headnode->children[0]->planenum = PLANENUM_LEAF; headnode->children[0]->planenum = PLANENUM_LEAF;
headnode->children[0]->contents = options.target_game->create_empty_contents(); headnode->children[0]->contents = options.target_game->create_empty_contents();
@ -968,7 +968,7 @@ tree_t *BrushBSP(mapentity_t *entity, bool midsplit)
usemidsplit = midsplit; usemidsplit = midsplit;
// calculate a bounding box for the entire model // calculate a bounding box for the entire model
headnode->bounds = entity->bounds.grow(SIDESPACE); headnode->bounds = entity->bounds;
// recursively partition everything // recursively partition everything
splitnodes = 0; splitnodes = 0;

View File

@ -269,8 +269,8 @@ void ExportDrawNodes(mapentity_t *entity, node_t *headnode, int firstface)
/* remove the headnode padding */ /* remove the headnode padding */
for (size_t i = 0; i < 3; i++) { for (size_t i = 0; i < 3; i++) {
dmodel.mins[i] = headnode->bounds.mins()[i] + SIDESPACE + 1; dmodel.mins[i] = headnode->bounds.mins()[i] + SIDESPACE;
dmodel.maxs[i] = headnode->bounds.maxs()[i] - SIDESPACE - 1; dmodel.maxs[i] = headnode->bounds.maxs()[i] - SIDESPACE;
} }
} }