1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-07-02 16:38:41 +00:00

Fixed viewing range stuff a bit (now it works better with very low ranges)

This commit is contained in:
Perttu Ahola 2011-05-06 16:58:06 +03:00
parent 59c4a342a9
commit 1a6e1e142f
2 changed files with 44 additions and 16 deletions

View file

@ -184,6 +184,10 @@ bool isBlockInSight(v3s16 blockpos_b, v3f camera_pos, v3f camera_dir, f32 range,
if(distance_ptr)
*distance_ptr = d;
// If block is very close, it is always in sight
if(d < 1.44*1.44*MAP_BLOCKSIZE*BS/2)
return true;
// If block is far away, it's not in sight
if(d > range * BS)
return false;