Browse Source

Also add leaf bounding sphere for optional per-leaf frustum culling.

master
Nico de Poel 3 years ago
parent
commit
cc1fcec7ea
  1. 2
      main.cpp
  2. 3
      ps1bsp.h

2
main.cpp

@ -255,7 +255,7 @@ int process_faces(const world_t* world, const std::vector<ps1bsp_texture_t>& tex
outLeaf.firstLeafFace = leaf->lface_id;
outLeaf.numLeafFaces = leaf->lface_num;
//outLeaf.center = convertWorldPosition(leaf->bound.getCenter());
outLeaf.boundingSphere = leaf->bound.toBoundingSphere();
outLeaves.push_back(outLeaf);
}

3
ps1bsp.h

@ -143,8 +143,7 @@ typedef struct
int type;
int vislist;
// TODO: add bounding box for frustum culling (or do we? could save half the number of bounds checks if we only check nodes)
//SVECTOR center;
SVECTOR boundingSphere;
u_short firstLeafFace;
u_short numLeafFaces;

Loading…
Cancel
Save