summary refs log tree commit diff
path: root/src/World/Chunk.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/World/Chunk.cpp')
-rw-r--r--src/World/Chunk.cpp15
1 files changed, 9 insertions, 6 deletions
diff --git a/src/World/Chunk.cpp b/src/World/Chunk.cpp
index 8b204c0..6cb67bb 100644
--- a/src/World/Chunk.cpp
+++ b/src/World/Chunk.cpp
@@ -19,10 +19,6 @@ Chunk::BlockData& Chunk::at(Position::BlockLocal pos) {
     return at(pos.x(), pos.y(), pos.z());
 }
 
-Bool Chunk::is_empty(U32 x, U32 y, U32 z) const {
-    return at(x, y, z).empty();
-}
-
 ChunkIndex Chunk::index() const {
     return m_index;
 }
@@ -39,12 +35,19 @@ void Chunk::damage() {
     m_damaged = true;
 }
 
-Bool Chunk::is_valid_position(U32 x, U32 y, U32 z) {
-    return x < Width && y < Height && z < Width;
+Bool Chunk::is_valid_position(Position::BlockLocal pos) {
+    return pos.x() < Width && pos.y() < Height && pos.z() < Width;
 }
 
 U64 Chunk::pos(U32 x, U32 y, U32 z) {
     return x + Width * y + Width * Height * z;
 }
 
+AABB Chunk::block_bounds(Position::BlockLocal pos) {
+    return {
+        {pos.x(), pos.y(), pos.z()},
+        {pos.x() + 1, pos.y() + 1, pos.z() + 1},
+    };
+}
+
 }