mirror of
https://github.com/griffi-gh/kubi.git
synced 2024-12-25 21:28:20 -06:00
fix bug in neighbor code
This commit is contained in:
parent
8e6c4e9a15
commit
fc7792382c
|
@ -88,8 +88,8 @@ impl super::ChunkStorage {
|
||||||
pub fn neighbors(&self, coords: IVec3) -> ChunkNeighbors {
|
pub fn neighbors(&self, coords: IVec3) -> ChunkNeighbors {
|
||||||
ChunkNeighbors {
|
ChunkNeighbors {
|
||||||
center: self.chunks.get(&coords),
|
center: self.chunks.get(&coords),
|
||||||
top: self.chunks.get(&(coords - ivec3(0, 1, 0))),
|
top: self.chunks.get(&(coords + ivec3(0, 1, 0))),
|
||||||
bottom: self.chunks.get(&(coords + ivec3(0, 1, 0))),
|
bottom: self.chunks.get(&(coords - ivec3(0, 1, 0))),
|
||||||
left: self.chunks.get(&(coords - ivec3(1, 0, 0))),
|
left: self.chunks.get(&(coords - ivec3(1, 0, 0))),
|
||||||
right: self.chunks.get(&(coords + ivec3(1, 0, 0))),
|
right: self.chunks.get(&(coords + ivec3(1, 0, 0))),
|
||||||
front: self.chunks.get(&(coords + ivec3(0, 0, 1))),
|
front: self.chunks.get(&(coords + ivec3(0, 0, 1))),
|
||||||
|
@ -110,8 +110,8 @@ impl super::ChunkStorage {
|
||||||
back
|
back
|
||||||
] = self.chunks.get_many_mut([
|
] = self.chunks.get_many_mut([
|
||||||
&coords,
|
&coords,
|
||||||
&(coords - ivec3(0, 1, 0)),
|
|
||||||
&(coords + ivec3(0, 1, 0)),
|
&(coords + ivec3(0, 1, 0)),
|
||||||
|
&(coords - ivec3(0, 1, 0)),
|
||||||
&(coords - ivec3(1, 0, 0)),
|
&(coords - ivec3(1, 0, 0)),
|
||||||
&(coords + ivec3(1, 0, 0)),
|
&(coords + ivec3(1, 0, 0)),
|
||||||
&(coords + ivec3(0, 0, 1)),
|
&(coords + ivec3(0, 0, 1)),
|
||||||
|
|
Loading…
Reference in a new issue