stabilize delays of chunks meshes building

This commit is contained in:
MihailRis 2025-12-29 20:41:47 +03:00
parent f47ccd5f30
commit 88544183d0
13 changed files with 335 additions and 191 deletions

View file

@ -23,6 +23,8 @@ class LevelEvents;
class Block;
class VoxelsVolume;
template <int w, int h, int d> class StaticVoxelsVolume;
/// Player-centred chunks matrix
class Chunks {
LevelEvents* events;
@ -128,7 +130,34 @@ public:
bool isReplaceableBlock(int32_t x, int32_t y, int32_t z);
bool isObstacleBlock(int32_t x, int32_t y, int32_t z);
void getVoxels(VoxelsVolume& volume, bool backlight = false, int top = CHUNK_H) const;
void getVoxels(
VoxelsVolume& volume, bool backlight = false, int top = CHUNK_H
) const;
template <int w, int h, int d>
void getVoxels(
StaticVoxelsVolume<w, h, d>& volume,
bool backlight = false,
int top = CHUNK_H
) const {
getVoxels(
volume.getVoxels(),
volume.getLights(),
{volume.getX(), volume.getY(), volume.getZ()},
{w, h, d},
backlight,
top
);
}
void getVoxels(
voxel* voxels,
light_t* lights,
const glm::ivec3& pos,
const glm::ivec3& size,
bool backlight,
int top
) const;
void setCenter(int32_t x, int32_t z);
void resize(uint32_t newW, uint32_t newD);