1
0
mirror of https://github.com/luanti-org/luanti.git synced 2025-10-13 16:45:20 +02:00

Client map: do frustum culling via planes (#12710)

This commit is contained in:
DS
2022-09-18 15:28:53 +02:00
committed by GitHub
parent a428a0cf37
commit c9ed059d91
8 changed files with 113 additions and 42 deletions

View File

@@ -1031,9 +1031,9 @@ void MapBlockBspTree::buildTree(const std::vector<MeshTriangle> *triangles)
/**
* @brief Find a candidate plane to split a set of triangles in two
*
*
* The candidate plane is represented by one of the triangles from the set.
*
*
* @param list Vector of indexes of the triangles in the set
* @param triangles Vector of all triangles in the BSP tree
* @return Address of the triangle that represents the proposed split plane
@@ -1225,7 +1225,7 @@ MapBlockMesh::MapBlockMesh(MeshMakeData *data, v3s16 camera_offset):
Convert FastFaces to MeshCollector
*/
MeshCollector collector;
MeshCollector collector(m_bounding_sphere_center);
{
// avg 0ms (100ms spikes when loading textures the first time)
@@ -1261,6 +1261,8 @@ MapBlockMesh::MapBlockMesh(MeshMakeData *data, v3s16 camera_offset):
const bool desync_animations = g_settings->getBool(
"desynchronize_mapblock_texture_animation");
m_bounding_radius = std::sqrt(collector.m_bounding_radius_sq);
for (int layer = 0; layer < MAX_TILE_LAYERS; layer++) {
for(u32 i = 0; i < collector.prebuffers[layer].size(); i++)
{