summaryrefslogtreecommitdiffstats
path: root/game/shared/world/chunk_aabb.hh
diff options
context:
space:
mode:
authoruntodesu <kirill@untode.su>2025-07-01 03:08:39 +0500
committeruntodesu <kirill@untode.su>2025-07-01 03:08:39 +0500
commit458e0005690ea9d579588a0a12368fc2c2c9a93a (patch)
tree588a9ca6cb3c76d9193b5bd4601d64f0e50e8c8c /game/shared/world/chunk_aabb.hh
parentc7b0c8e0286a1b2bb7ec55e579137dfc3b22eeb9 (diff)
downloadvoxelius-458e0005690ea9d579588a0a12368fc2c2c9a93a.tar.bz2
voxelius-458e0005690ea9d579588a0a12368fc2c2c9a93a.zip
I hyper-focued on refactoring again
- I put a cool-sounding "we are number one" remix on repeat and straight up grinded the entire repository to a better state until 03:09 AM. I guess I have something wrong in my brain that makes me do this shit
Diffstat (limited to 'game/shared/world/chunk_aabb.hh')
-rw-r--r--game/shared/world/chunk_aabb.hh33
1 files changed, 33 insertions, 0 deletions
diff --git a/game/shared/world/chunk_aabb.hh b/game/shared/world/chunk_aabb.hh
new file mode 100644
index 0000000..bd4a0c5
--- /dev/null
+++ b/game/shared/world/chunk_aabb.hh
@@ -0,0 +1,33 @@
+#ifndef SHARED_CHUNK_AABB
+#define SHARED_CHUNK_AABB 1
+#pragma once
+
+#include "shared/types.hh"
+
+namespace world
+{
+class ChunkAABB final {
+public:
+ ChunkAABB(void) = default;
+ virtual ~ChunkAABB(void) = default;
+
+ void set_bounds(const chunk_pos& min, const chunk_pos& max);
+ void set_offset(const chunk_pos& base, const chunk_pos& size);
+
+ const chunk_pos& get_min(void) const;
+ const chunk_pos& get_max(void) const;
+
+ bool contains(const chunk_pos& point) const;
+ bool intersect(const ChunkAABB& other_box) const;
+
+ ChunkAABB combine_with(const ChunkAABB& other_box) const;
+ ChunkAABB multiply_with(const ChunkAABB& other_box) const;
+ ChunkAABB push(const chunk_pos& vector) const;
+
+public:
+ chunk_pos min;
+ chunk_pos max;
+};
+} // namespace world
+
+#endif // SHARED_CHUNK_AABB