diff options
author | DS <vorunbekannt75@web.de> | 2022-09-18 15:28:53 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-09-18 15:28:53 +0200 |
commit | c9ed059d9170f2f7f662cbb59e6009fd54c8ed3f (patch) | |
tree | 99b6adee12a0e76b3f2a25e2a6e5975bfaeaac28 /src/client/mapblock_mesh.h | |
parent | a428a0cf37581a35f9c4f81c2e71633e6cc3dbb9 (diff) | |
download | minetest-c9ed059d9170f2f7f662cbb59e6009fd54c8ed3f.tar.xz |
Client map: do frustum culling via planes (#12710)
Diffstat (limited to 'src/client/mapblock_mesh.h')
-rw-r--r-- | src/client/mapblock_mesh.h | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/src/client/mapblock_mesh.h b/src/client/mapblock_mesh.h index 169b3a8c1..f22dd68bd 100644 --- a/src/client/mapblock_mesh.h +++ b/src/client/mapblock_mesh.h @@ -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; |