feat: redone visualization to be human-generated
This commit is contained in:
parent
9edb79e970
commit
5b4ad9a47a
9 changed files with 214 additions and 24 deletions
|
|
@ -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();
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue