]> git.lizzy.rs Git - dragonfireclient.git/blobdiff - src/util/numeric.h
Keep mapblocks in memory if they're in range (#10714)
[dragonfireclient.git] / src / util / numeric.h
index 864ab754369be02c5c524de2b1e5ab687eb60e9e..32a6f4312b04abc975a96021912fff965f8502de 100644 (file)
@@ -20,6 +20,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
 #pragma once
 
 #include "basic_macros.h"
+#include "constants.h"
 #include "irrlichttypes.h"
 #include "irr_v2d.h"
 #include "irr_v3d.h"
@@ -36,6 +37,9 @@ with this program; if not, write to the Free Software Foundation, Inc.,
        y = temp; \
 } while (0)
 
+// Maximum radius of a block.  The magic number is
+// sqrt(3.0) / 2.0 in literal form.
+static constexpr const f32 BLOCK_MAX_RADIUS = 0.866025403784f * MAP_BLOCKSIZE * BS;
 
 inline s16 getContainerPos(s16 p, s16 d)
 {