diff options
| author | untodesu <kirill@untode.su> | 2025-03-15 16:22:09 +0500 |
|---|---|---|
| committer | untodesu <kirill@untode.su> | 2025-03-15 16:22:09 +0500 |
| commit | 3bf42c6ff3805a0d42bbc661794a95ff31bedc26 (patch) | |
| tree | 05049955847504808d6bed2bb7b155f8b03807bb /game/shared/chunk_aabb.hh | |
| parent | 02294547dcde0d4ad76e229106702261e9f10a51 (diff) | |
| download | voxelius-3bf42c6ff3805a0d42bbc661794a95ff31bedc26.tar.bz2 voxelius-3bf42c6ff3805a0d42bbc661794a95ff31bedc26.zip | |
Add whatever I was working on for the last month
Diffstat (limited to 'game/shared/chunk_aabb.hh')
| -rw-r--r-- | game/shared/chunk_aabb.hh | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/game/shared/chunk_aabb.hh b/game/shared/chunk_aabb.hh new file mode 100644 index 0000000..68b8701 --- /dev/null +++ b/game/shared/chunk_aabb.hh @@ -0,0 +1,30 @@ +#ifndef SHARED_CHUNK_AABB +#define SHARED_CHUNK_AABB 1 +#pragma once + +#include "shared/types.hh" + +class ChunkAABB final { +public: + explicit 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; +}; + +#endif /* SHARED_CHUNK_AABB */ |
