fixed chunk disappearing while standing inside of this chunk

Commit 57d803541ec5 · mgecumshooter · 2026-10-21 15:22 +0300

Changeset
57d803541ec534db573fbe07d557a159a703b991

View source at this commit

Comments

No comments yet.

Log in to comment

Diff

diff --git a/src/chunk/mod.rs b/src/chunk/mod.rs
--- a/src/chunk/mod.rs
+++ b/src/chunk/mod.rs
@@ -75,6 +75,10 @@
 	let half_fov = (cam.fovy.to_radians() / 2f32) * 1f32;
 	let angular_margin = (radius / dist).atan();
 
+	if dist <= CHUNK_SIZE as f32 {
+	    return true;
+	}
+
 	cos_angle.acos() <= half_fov + angular_margin
     }