mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-11 14:01:49 +00:00
fix
This commit is contained in:
parent
fc3d5c5484
commit
f50b87e674
1 changed files with 3 additions and 3 deletions
|
|
@ -152,9 +152,9 @@ void WorldRenderer::drawChunks(
|
||||||
float px = camera.position.x / static_cast<float>(CHUNK_W) - 0.5f;
|
float px = camera.position.x / static_cast<float>(CHUNK_W) - 0.5f;
|
||||||
float pz = camera.position.z / static_cast<float>(CHUNK_D) - 0.5f;
|
float pz = camera.position.z / static_cast<float>(CHUNK_D) - 0.5f;
|
||||||
for (auto& index : indices) {
|
for (auto& index : indices) {
|
||||||
int x = index.index % chunksWidth + chunksOffsetX - px;
|
float x = index.index % chunksWidth + chunksOffsetX - px;
|
||||||
int z = index.index / chunksWidth + chunksOffsetY - pz;
|
float z = index.index / chunksWidth + chunksOffsetY - pz;
|
||||||
index.d = x * x + z * z;
|
index.d = (x * x + z * z) * 16;
|
||||||
}
|
}
|
||||||
util::insertion_sort(indices.begin(), indices.end());
|
util::insertion_sort(indices.begin(), indices.end());
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue