39 lines
1.1 KiB
C++
39 lines
1.1 KiB
C++
#include "Deer/VoxelWorld.h"
|
|
#include "Deer/Voxels/Chunk.h"
|
|
#include "DeerRender/Voxels/VoxelWorldRenderData.h"
|
|
|
|
namespace Deer {
|
|
namespace VoxelWorld {
|
|
// Chunk render data
|
|
Scope<ChunkRender[]> chunksRender;
|
|
ChunkUpdateQueue chunkQueue;
|
|
|
|
// Voxel creation data
|
|
std::vector<uint32_t> indices;
|
|
std::vector<SolidVoxelVertexData> vertexData;
|
|
std::queue<VoxelCordinates> ambientLightPropagation;
|
|
std::queue<VoxelCordinates> voxelLightPropagation;
|
|
std::vector<VoxelCordinates> tmp_voxelLightSource;
|
|
}
|
|
|
|
void VoxelWorld::clearRenderVars() {
|
|
chunksRender.reset();
|
|
chunkQueue.reset();
|
|
|
|
indices.clear();
|
|
vertexData.clear();
|
|
|
|
while (!ambientLightPropagation.empty()) {
|
|
ambientLightPropagation.pop();
|
|
}
|
|
while (!voxelLightPropagation.empty()) {
|
|
voxelLightPropagation.pop();
|
|
}
|
|
|
|
tmp_voxelLightSource.clear();
|
|
}
|
|
|
|
void VoxelWorld::initializeRenderVars(const VoxelWorldProps& props) {
|
|
chunksRender = MakeScope<ChunkRender[]>(props.getChunkCount());
|
|
}
|
|
} // namespace Deer
|