mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-06 19:41:51 +00:00
fix cross-chunk culling for extended blocks with precise mesh AABBs
This commit is contained in:
parent
27ce16db27
commit
4dc1fdbe05
4 changed files with 105 additions and 29 deletions
|
|
@ -11,6 +11,7 @@
|
|||
#include "maths/util.hpp"
|
||||
#include "commons.hpp"
|
||||
#include "settings.hpp"
|
||||
#include "maths/aabb.hpp"
|
||||
|
||||
template<typename VertexStructure> class Mesh;
|
||||
class Content;
|
||||
|
|
@ -48,6 +49,9 @@ class BlocksRenderer {
|
|||
util::PseudoRandom randomizer;
|
||||
|
||||
SortingMeshData sortingMesh;
|
||||
// Accumulated local-space AABB over opaque build pass
|
||||
AABB localAabb {glm::vec3(0.0f), glm::vec3(0.0f)};
|
||||
bool localAabbInit = false;
|
||||
|
||||
void vertex(
|
||||
const glm::vec3& coord,
|
||||
|
|
@ -172,6 +176,7 @@ public:
|
|||
ChunkMesh render(const Chunk* chunk, const Chunks* chunks);
|
||||
ChunkMeshData createMesh();
|
||||
VoxelsVolume* getVoxelsBuffer() const;
|
||||
inline const AABB& getLocalAabb() const { return localAabb; }
|
||||
|
||||
size_t getMemoryConsumption() const;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue