mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-09 04:51:49 +00:00
voxels renderer rebuilt, WorldFiles fix
This commit is contained in:
parent
0576316282
commit
754c5b80d0
44 changed files with 1141 additions and 524 deletions
30
src/voxels/VoxelsVolume.cpp
Normal file
30
src/voxels/VoxelsVolume.cpp
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
#include "VoxelsVolume.h"
|
||||
|
||||
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 = new voxel[w * h * d];
|
||||
for (int i = 0; i < w * h * d; i++) {
|
||||
voxels[i].id = BLOCK_VOID;
|
||||
}
|
||||
lights = new light_t[w * h * d];
|
||||
}
|
||||
|
||||
VoxelsVolume::VoxelsVolume(int w, int h, int d)
|
||||
: x(0), y(0), z(0), w(w), h(h), d(d) {
|
||||
voxels = new voxel[w * h * d];
|
||||
for (int i = 0; i < w * h * d; i++) {
|
||||
voxels[i].id = BLOCK_VOID;
|
||||
}
|
||||
lights = new light_t[w * h * d];
|
||||
}
|
||||
|
||||
VoxelsVolume::~VoxelsVolume() {
|
||||
delete[] lights;
|
||||
delete[] voxels;
|
||||
}
|
||||
|
||||
void VoxelsVolume::setPosition(int x, int y, int z) {
|
||||
this->x = x;
|
||||
this->y = y;
|
||||
this->z = z;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue