summary refs log tree commit diff
path: root/src/World/ChunkIndex.hpp
diff options
context:
space:
mode:
authorMel <einebeere@gmail.com>2023-06-12 23:07:36 +0200
committerMel <einebeere@gmail.com>2023-06-12 23:07:36 +0200
commit92ac46df6afa8ee76f972cceb681cf32658f84a2 (patch)
tree6ff89b9d6e8e0568f346b5f7b8b9e7ba3e74211e /src/World/ChunkIndex.hpp
parentd0de60dc33df75fbcacb53a09568b14d0fd48cb9 (diff)
downloadmeowcraft-92ac46df6afa8ee76f972cceb681cf32658f84a2.tar.zst
meowcraft-92ac46df6afa8ee76f972cceb681cf32658f84a2.zip
Start generation from player position
Diffstat (limited to 'src/World/ChunkIndex.hpp')
-rw-r--r--src/World/ChunkIndex.hpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/World/ChunkIndex.hpp b/src/World/ChunkIndex.hpp
index bdb49b3..4701581 100644
--- a/src/World/ChunkIndex.hpp
+++ b/src/World/ChunkIndex.hpp
@@ -10,6 +10,10 @@ struct ChunkIndex {
     ChunkIndex() : x(0), y(0) {}
     ChunkIndex(int32_t x, int32_t y) : x(x), y(y) {}
 
+    Vector<3> middle() const {
+        return {(x + 0.5f) * Chunk::Width, Chunk::Height / 2.0f, (y + 0.5f) * Chunk::Width};
+    }
+
     int32_t x, y;
 };