fixes double neighbor assignement and cubes inside of empty volumes after skipping to grow
This commit is contained in:
parent
5353f28acd
commit
457d3e2d6b
7 changed files with 165 additions and 105 deletions
src/scene
|
@ -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)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue