diff options
| author | Mel <einebeere@gmail.com> | 2022-10-21 17:46:35 +0200 |
|---|---|---|
| committer | Mel <einebeere@gmail.com> | 2022-10-21 17:46:35 +0200 |
| commit | 20c53c7473fc6cc08944f502f078dfe57bcae1c9 (patch) | |
| tree | 7e6b09cea68251d4564a363c1a372d6daf746dcf /src/World/Chunk.hpp | |
| parent | 6ed978051668c08f5a957c97570f364dd580c807 (diff) | |
| download | meowcraft-20c53c7473fc6cc08944f502f078dfe57bcae1c9.tar.zst meowcraft-20c53c7473fc6cc08944f502f078dfe57bcae1c9.zip | |
Broken infinite world
Diffstat (limited to 'src/World/Chunk.hpp')
| -rw-r--r-- | src/World/Chunk.hpp | 6 |
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]; }; |
