1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-08-01 17:38:41 +00: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
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 113 additions and 42 deletions

View file

@ -100,7 +100,7 @@ public:
};
/**
* Implements a binary space partitioning tree
* Implements a binary space partitioning tree
* See also: https://en.wikipedia.org/wiki/Binary_space_partitioning
*/
class MapBlockBspTree
@ -221,6 +221,12 @@ public:
m_animation_force_timer--;
}
/// Radius of the bounding-sphere, in BS-space.
f32 getBoundingRadius() const { return m_bounding_radius; }
/// Center of the bounding-sphere, in BS-space, relative to block pos.
v3f getBoundingSphereCenter() const { return m_bounding_sphere_center; }
/// update transparent buffers to render towards the camera
void updateTransparentBuffers(v3f camera_pos, v3s16 block_pos);
void consolidateTransparentBuffers();
@ -243,6 +249,10 @@ private:
ITextureSource *m_tsrc;
IShaderSource *m_shdrsrc;
f32 m_bounding_radius;
// MapblockMeshGenerator uses the same as mapblock center
v3f m_bounding_sphere_center = v3f((MAP_BLOCKSIZE * 0.5f - 0.5f) * BS);
bool m_enable_shaders;
bool m_enable_vbo;