Fixed zoom, changed camera shaking parameters

This commit is contained in:
MihailRis
2022-03-04 16:53:55 +03:00
committed by GitHub
parent cdc8a26a30
commit 1dd9a72fb3
4 changed files with 38 additions and 16 deletions
+12 -1
View File
@@ -295,7 +295,7 @@ Mesh* VoxelRenderer::render(Chunk* chunk, const Chunk** chunks){
for (int z = 0; z < CHUNK_D; z++){
for (int x = 0; x < CHUNK_W; x++){
voxel vox = chunk->voxels[(y * CHUNK_D + z) * CHUNK_W + x];
if (vox.id == 9)
if (vox.id == 9 || vox.id == 4)
continue;
_renderBlock(buffer, x, y, z, chunks, vox, index);
}
@@ -312,5 +312,16 @@ Mesh* VoxelRenderer::render(Chunk* chunk, const Chunk** chunks){
}
}
}
for (int y = 0; y < CHUNK_H; y++){
for (int z = 0; z < CHUNK_D; z++){
for (int x = 0; x < CHUNK_W; x++){
voxel vox = chunk->voxels[(y * CHUNK_D + z) * CHUNK_W + x];
if (vox.id != 4)
continue;
_renderBlock(buffer, x, y, z, chunks, vox, index);
}
}
}
return new Mesh(buffer, index / VERTEX_SIZE, chunk_attrs);
}