Fix voxel sphere offset

This commit is contained in:
Jarrod Doyle 2023-04-24 09:49:07 +01:00
parent 230024ac63
commit 55b79f0b39
Signed by: Jayrude
GPG Key ID: 38B57B16E7C0ADF7
1 changed files with 1 additions and 1 deletions

View File

@ -45,7 +45,7 @@ impl Renderer {
for z in 0..8 { for z in 0..8 {
for y in 0..8 { for y in 0..8 {
for x in 0..8 { for x in 0..8 {
let pos = glam::vec3(x as f32, y as f32, z as f32) - glam::vec3(4.0, 4.0, 4.0); let pos = glam::vec3(x as f32, y as f32, z as f32) - glam::vec3(3.5, 3.5, 3.5);
if pos.length_squared() <= (u32::pow(4, 2) as f32) { if pos.length_squared() <= (u32::pow(4, 2) as f32) {
data.push(((x + 1) * 32 - 1) as u8); data.push(((x + 1) * 32 - 1) as u8);
data.push(((y + 1) * 32 - 1) as u8); data.push(((y + 1) * 32 - 1) as u8);