fixes double neighbor assignement and cubes inside of empty volumes after skipping to grow

This commit is contained in:
zomseffen 2025-02-26 12:31:58 +01:00
parent 5353f28acd
commit 457d3e2d6b
7 changed files with 165 additions and 105 deletions
src/scene

View file

@ -191,9 +191,6 @@ impl<T: Clone> OctTree<T> {
}
}
else {
if let Some(_) = self.blocks[z * MIN_CHUNK_SIZE * MIN_CHUNK_SIZE + y * MIN_CHUNK_SIZE + x] {
println!("overwriting block!")
}
self.blocks[z * MIN_CHUNK_SIZE * MIN_CHUNK_SIZE + y * MIN_CHUNK_SIZE + x] = Some(element);
}
}
@ -471,10 +468,10 @@ impl<T: Clone> OctTree<T> {
}
else {
if let Some(c) = &self.blocks[z * MIN_CHUNK_SIZE * MIN_CHUNK_SIZE + y * MIN_CHUNK_SIZE + x] {
(true, 1, (x, y, z), Some(c.clone()))
(true, 1, (node_start_x + x, node_start_y + y, node_start_z + z), Some(c.clone()))
}
else {
(false, 1, (x, y, z), None)
(false, 1, (node_start_x + x, node_start_y + y, node_start_z + z), None)
}
}
}