X-Git-Url: http://git.localhorst.tv/?a=blobdiff_plain;f=src%2Fworld%2FChunk.hpp;h=4938c1b1a7a92f3f34c861e30287ca23491c6686;hb=3b2fe22c33074664b0c4f24be374e4e6c1c0ed2f;hp=6e87a0907d15059cea8b15e5255022b333b4c12b;hpb=4727825186798902f68df5b99a6a32f0ef618454;p=blank.git diff --git a/src/world/Chunk.hpp b/src/world/Chunk.hpp index 6e87a09..4938c1b 100644 --- a/src/world/Chunk.hpp +++ b/src/world/Chunk.hpp @@ -14,6 +14,7 @@ namespace blank { class BlockType; +class Entity; class WorldCollision; /// cube of size 16 (256 tiles, 4096 blocks) @@ -30,6 +31,8 @@ public: static constexpr int size = side * side * side; static AABB Bounds() noexcept { return AABB{ { 0.0f, 0.0f, 0.0f }, ExactLocation::FExtent() }; } + static glm::vec3 Center() noexcept { return glm::vec3(8.0f); } + static float Radius() noexcept { return 27.71281292110203669632f; /* 16 * √3 */ } static constexpr bool InBounds(const ExactLocation::Fine &pos) noexcept { return @@ -144,6 +147,12 @@ public: const glm::mat4 &Mchunk, std::vector &) noexcept; + bool Intersection( + const Entity &entity, + const glm::mat4 &Mentity, + const glm::mat4 &Mchunk, + std::vector &) noexcept; + void Position(const ExactLocation::Coarse &pos) noexcept { position = pos; } const ExactLocation::Coarse &Position() const noexcept { return position; } glm::mat4 Transform(const ExactLocation::Coarse &offset) const noexcept {