From 6cd00aacfa22fed6a54a9b812f6b069ad16feec0 Mon Sep 17 00:00:00 2001 From: untodesu Date: Sun, 29 Jun 2025 22:24:42 +0500 Subject: Move game sources into src subdirectory --- src/game/shared/chunk_aabb.hh | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 src/game/shared/chunk_aabb.hh (limited to 'src/game/shared/chunk_aabb.hh') diff --git a/src/game/shared/chunk_aabb.hh b/src/game/shared/chunk_aabb.hh new file mode 100644 index 0000000..7a35dd4 --- /dev/null +++ b/src/game/shared/chunk_aabb.hh @@ -0,0 +1,32 @@ +#ifndef SHARED_CHUNK_AABB +#define SHARED_CHUNK_AABB 1 +#pragma once + +#include "core/macros.hh" + +#include "shared/types.hh" + +class ChunkAABB final { +public: + DECLARE_DEFAULT_CONSTRUCTOR(ChunkAABB); + 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 */ -- cgit