summary refs log tree commit diff
path: root/src/World/Chunk.hpp
diff options
context:
space:
mode:
authorMel <einebeere@gmail.com>2022-10-21 17:46:35 +0200
committerMel <einebeere@gmail.com>2022-10-21 17:46:35 +0200
commit20c53c7473fc6cc08944f502f078dfe57bcae1c9 (patch)
tree7e6b09cea68251d4564a363c1a372d6daf746dcf /src/World/Chunk.hpp
parent6ed978051668c08f5a957c97570f364dd580c807 (diff)
downloadmeowcraft-20c53c7473fc6cc08944f502f078dfe57bcae1c9.tar.zst
meowcraft-20c53c7473fc6cc08944f502f078dfe57bcae1c9.zip
Broken infinite world
Diffstat (limited to 'src/World/Chunk.hpp')
-rw-r--r--src/World/Chunk.hpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/World/Chunk.hpp b/src/World/Chunk.hpp
index 7a93f5a..797a757 100644
--- a/src/World/Chunk.hpp
+++ b/src/World/Chunk.hpp
@@ -14,9 +14,12 @@ namespace MC::World {
 
 class Chunk {
 public:
-    Chunk() : m_blocks{} {};
+    Chunk(int64_t x, int64_t y)
+        : m_blocks{}, m_position{(float)x * CHUNK_WIDTH, 0.0f, (float)y * CHUNK_WIDTH} {};
 
     void set(uint32_t x, uint32_t y, uint32_t z, BlockType type);
+
+    Vector<3> position();
     GFX::Mesh mesh();
 private:
     bool is_face_visible(uint32_t x, uint32_t y, uint32_t z, BlockSide side);
@@ -27,6 +30,7 @@ private:
         BlockType type;
     };
 
+    Vector<3> m_position;
     BlockData m_blocks[CHUNK_WIDTH][CHUNK_HEIGHT][CHUNK_WIDTH];
 };