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

@ -1,28 +0,0 @@
#include "VoxelsVolume.hpp"
VoxelsVolume::VoxelsVolume(int x, int y, int z, int w, int h, int d)
: x(x),
y(y),
z(z),
w(w),
h(h),
d(d),
voxels(std::make_unique<voxel[]>(w * h * d)),
lights(std::make_unique<light_t[]>(w * h * d)) {
for (int i = 0; i < w * h * d; i++) {
voxels[i].id = BLOCK_VOID;
}
}
VoxelsVolume::VoxelsVolume(int w, int h, int d)
: VoxelsVolume(0, 0, 0, w, h, d) {
}
VoxelsVolume::~VoxelsVolume() {
}
void VoxelsVolume::setPosition(int x, int y, int z) {
this->x = x;
this->y = y;
this->z = z;
}