Renamed chunk get_block pos argument to block_pos

This commit is contained in:
Jarrod Doyle 2023-07-28 11:48:00 +01:00
parent e1d621f573
commit 081ce7ec77
Signed by: Jayrude
GPG Key ID: 38B57B16E7C0ADF7
1 changed files with 3 additions and 3 deletions

View File

@ -15,9 +15,9 @@ pub struct Chunk {
} }
impl Chunk { impl Chunk {
fn get_block(&mut self, pos: glam::UVec3, chunk_dims: glam::UVec3) -> Vec<Voxel> { fn get_block(&mut self, block_pos: glam::UVec3, chunk_dims: glam::UVec3) -> Vec<Voxel> {
let noise_dims = chunk_dims + glam::uvec3(1, 1, 1); let noise_dims = chunk_dims + glam::uvec3(1, 1, 1);
let block_idx = math::to_1d_index(pos, chunk_dims); let block_idx = math::to_1d_index(block_pos, chunk_dims);
assert_eq!( assert_eq!(
self.blocks.len(), self.blocks.len(),
(chunk_dims.x * chunk_dims.y * chunk_dims.z) as usize (chunk_dims.x * chunk_dims.y * chunk_dims.z) as usize
@ -27,7 +27,7 @@ impl Chunk {
if !block.is_empty() { if !block.is_empty() {
block.to_owned() block.to_owned()
} else { } else {
self.gen_block(pos, block_idx, noise_dims); self.gen_block(block_pos, block_idx, noise_dims);
self.blocks[block_idx].to_owned() self.blocks[block_idx].to_owned()
} }
} }