diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/RTree.hpp | 1 | ||||
-rw-r--r-- | src/chunk-collision.cpp | 3 | ||||
-rw-r--r-- | src/chunk.hpp | 3 |
3 files changed, 6 insertions, 1 deletions
diff --git a/src/RTree.hpp b/src/RTree.hpp index a8f9e031..12b55157 100644 --- a/src/RTree.hpp +++ b/src/RTree.hpp @@ -1,6 +1,7 @@ #pragma once #include "RTree.h" + #include <math.h> #include <stdlib.h> #include <cassert> diff --git a/src/chunk-collision.cpp b/src/chunk-collision.cpp index bec90f32..f37fd24b 100644 --- a/src/chunk-collision.cpp +++ b/src/chunk-collision.cpp @@ -6,6 +6,9 @@ namespace floormat { +const RTree<std::uint64_t, float, 2, float>* chunk::rtree() const noexcept { return &_rtree; } +RTree<std::uint64_t, float, 2, float>* chunk::rtree() noexcept { return &_rtree; } + namespace { constexpr Vector2 tile_start(std::size_t k) diff --git a/src/chunk.hpp b/src/chunk.hpp index f117237c..0cd7dfc7 100644 --- a/src/chunk.hpp +++ b/src/chunk.hpp @@ -86,7 +86,8 @@ struct chunk final void ensure_passability() noexcept; - RTree<std::uint64_t, float, 2, float>* rtree() const noexcept { return &const_cast<chunk*>(this)->_rtree; } + const RTree<std::uint64_t, float, 2, float>* rtree() const noexcept; + RTree<std::uint64_t, float, 2, float>* rtree() noexcept; private: std::array<std::shared_ptr<tile_atlas>, TILE_COUNT> _ground_atlases; |