From aaf5245aba8daba3ec0b47974b8b7c7880a6738b Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Sat, 21 Oct 2023 20:56:09 +0200 Subject: a --- src/RTree-search.hpp | 12 ++++++++++++ src/path-search.cpp | 5 ----- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/src/RTree-search.hpp b/src/RTree-search.hpp index 4b824cd6..47c53592 100644 --- a/src/RTree-search.hpp +++ b/src/RTree-search.hpp @@ -1,6 +1,18 @@ #pragma once #include "compat/assert.hpp" #include "RTree.h" +#include +#include + +namespace floormat { + +constexpr inline bool rect_intersects(Vector2 min1, Vector2 max1, Vector2 min2, Vector2 max2) +{ + return min1.x() < max2.x() && max1.x() > min2.x() && + min1.y() < max2.y() && max1.y() > min2.y(); +} + +} // namespace floormat RTREE_TEMPLATE template diff --git a/src/path-search.cpp b/src/path-search.cpp index 66a7e4af..2f799f73 100644 --- a/src/path-search.cpp +++ b/src/path-search.cpp @@ -22,11 +22,6 @@ constexpr auto never_continue_ = path_search::pred{never_continue_1}; constexpr auto always_continue_1 = [](collision_data) constexpr { return path_search_continue::pass; }; constexpr auto always_continue_ = path_search::pred{always_continue_1}; -inline bool rect_intersects(Vector2 min1, Vector2 max1, Vector2 min2, Vector2 max2) -{ - return bool{min1 < max2} && bool{max1 > min2}; -} - } // namespace auto path_search::never_continue() noexcept -> const pred& { return never_continue_; } -- cgit v1.2.3