feat: redone visualization to be human-generated

This commit is contained in:
Rendo 2026-08-01 23:44:56 +05:00
commit 5b4ad9a47a
9 changed files with 214 additions and 24 deletions

View file

@ -10,7 +10,9 @@ impl<'a> GridManipulationTools<'a> {
Self { grid }
}
pub fn set_xyz(&mut self,x: u32, y: u32, z: u32, element: GridElement) {
let index = self.grid.indexify(UVec3::new(x,y,z));
let Some(index) = self.grid.indexify(UVec3::new(x,y,z)) else {
return;
};
self.grid.data[index] = element;
}
pub fn fill_xyz(&mut self,x1: u32, y1: u32, z1: u32, x2: u32, y2: u32, z2: u32, element: GridElement) {
@ -21,7 +23,9 @@ impl<'a> GridManipulationTools<'a> {
for x in x1..=x2 {
for y in y1..=y2 {
for z in z1..=z2 {
let index = self.grid.indexify(UVec3::new(x,y,z));
let Some(index) = self.grid.indexify(UVec3::new(x,y,z)) else {
continue;
};
self.grid.data[index] = element.clone();
}