continue traversing nodes if brick not hit

This commit is contained in:
Piotrek
2021-04-23 16:06:54 +02:00
parent af5c2f2532
commit b59523c13b
7 changed files with 20 additions and 15 deletions
+2 -2
View File
@@ -2,7 +2,7 @@ use wgpu::util::DeviceExt;
use std::convert::TryInto;
const BRICK_SIZE : usize = 32; // 32x32x32 brick size
const BRICK_NUM : usize = 2; // x bricks in texture
const BRICK_NUM : usize = 10000; // x bricks in texture
const BRICK_LEN : usize = BRICK_SIZE*BRICK_SIZE*BRICK_SIZE;
const DATA_LEN : usize = BRICK_LEN * BRICK_NUM;
@@ -102,7 +102,7 @@ impl BrickBuffer {
}
}
}
bricks.set(0, 0, 0, 0, 0);
bricks.set(1, 20, 5, 16, 1);
// Done
Self { bricks, texture, size, bind_layout, bind_group }
+3 -1
View File
@@ -70,7 +70,9 @@ impl NodeBuffer {
// Data
let mut nodes : [u32; NUM_NODES] = [Default::default(); NUM_NODES];
nodes[0] = 2;
nodes[0] = 1;
nodes[1] = 2;
nodes[2] = 2;
// Done
Self { nodes, texture, size, bind_layout, bind_group }