Skip to content

Commit

Permalink
when calculating adjacent chunk keys, make sure to multiply by the CH…
Browse files Browse the repository at this point in the history
…UNK_SHAPE; this is necessary now that chunk keys are just the minimum point in the chunk
  • Loading branch information
bonsairobo committed Nov 5, 2020
1 parent 7a6751f commit 7976835
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/voxel/editor.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use crate::voxel::{
chunk_cache_flusher::ChunkCacheFlusher, double_buffer::EditedChunksBackBuffer, VoxelDistance,
VoxelMap, VoxelType, EMPTY_VOXEL,
VoxelMap, VoxelType, EMPTY_VOXEL, VOXEL_CHUNK_SHAPE,
};

use amethyst::{core::ecs::prelude::*, derive::SystemDesc, shrev::EventChannel};
Expand Down Expand Up @@ -88,8 +88,8 @@ impl<'a> System<'a> for VoxelEditorSystem {
// We just always add the neighbors for simplicity.
let mut neighbor_chunks = Vec::new();
for chunk_key in edited_chunks.keys() {
for offset in Point3i::von_neumann_offsets().iter() {
neighbor_chunks.push(*chunk_key + *offset);
for offset in Point3i::moore_offsets().iter() {
neighbor_chunks.push(*chunk_key + *offset * VOXEL_CHUNK_SHAPE);
}
}

Expand Down

0 comments on commit 7976835

Please sign in to comment.