summaryrefslogtreecommitdiff
path: root/src/util/numeric.h
diff options
context:
space:
mode:
authorhecks <42101236+hecktest@users.noreply.github.com>2021-02-26 21:23:46 +0100
committerGitHub <noreply@github.com>2021-02-26 21:23:46 +0100
commit225e69063fa0c3dc96f960aa79dfc568fe3d89a8 (patch)
treeae6247d0a0d20ef26d73f1a156bb5d1467e58ae7 /src/util/numeric.h
parent3edb1ddb8127aa7e8de867be50c695271091cb94 (diff)
downloadminetest-225e69063fa0c3dc96f960aa79dfc568fe3d89a8.tar.gz
minetest-225e69063fa0c3dc96f960aa79dfc568fe3d89a8.tar.bz2
minetest-225e69063fa0c3dc96f960aa79dfc568fe3d89a8.zip
Keep mapblocks in memory if they're in range (#10714)
Some other minor parts of clientmap.cpp have been cleaned up along the way
Diffstat (limited to 'src/util/numeric.h')
-rw-r--r--src/util/numeric.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/util/numeric.h b/src/util/numeric.h
index 864ab7543..32a6f4312 100644
--- a/src/util/numeric.h
+++ b/src/util/numeric.h
@@ -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)
{