CPU Brickmap now requests the correct chunk
This commit is contained in:
parent
64ddcf7e10
commit
0e1b844f96
|
@ -159,8 +159,14 @@ impl BrickmapManager {
|
||||||
let chunk_y = data[i * 4 + 1];
|
let chunk_y = data[i * 4 + 1];
|
||||||
let chunk_z = data[i * 4 + 2];
|
let chunk_z = data[i * 4 + 2];
|
||||||
|
|
||||||
let chunk_pos = glam::ivec3(0, 0, 0);
|
let chunk_dims = world.get_chunk_dims();
|
||||||
let block_pos = glam::uvec3(chunk_x, chunk_y, chunk_z);
|
let global_block_pos = glam::uvec3(chunk_x, chunk_y, chunk_z);
|
||||||
|
let chunk_pos = glam::ivec3(
|
||||||
|
(global_block_pos.x / chunk_dims.x) as i32,
|
||||||
|
(global_block_pos.y / chunk_dims.y) as i32,
|
||||||
|
(global_block_pos.z / chunk_dims.z) as i32,
|
||||||
|
);
|
||||||
|
let block_pos = global_block_pos % chunk_dims;
|
||||||
let block = world.get_block(chunk_pos, block_pos);
|
let block = world.get_block(chunk_pos, block_pos);
|
||||||
assert_eq!(block.len(), 512);
|
assert_eq!(block.len(), 512);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue