From 854060277abd5d2c8e1e37b67d9e65cceea8d6c9 Mon Sep 17 00:00:00 2001 From: Javidx9 <25419386+OneLoneCoder@users.noreply.github.com> Date: Tue, 20 Sep 2022 21:43:33 +0100 Subject: [PATCH] Tidied up quad tree --- utilities/olcUTIL_QuadTree.h | 29 +---------------------------- 1 file changed, 1 insertion(+), 28 deletions(-) diff --git a/utilities/olcUTIL_QuadTree.h b/utilities/olcUTIL_QuadTree.h index 3dbccbb..09ca105 100644 --- a/utilities/olcUTIL_QuadTree.h +++ b/utilities/olcUTIL_QuadTree.h @@ -1,7 +1,7 @@ /* OneLoneCoder - QuadTree v1.00 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - A Dynamic geom2d::rect-Tree implementation to store objects in a 2D space + A Dynamic Quad-Tree implementation to store objects in a 2D space with a fast retrieval. License (OLC-3) @@ -62,33 +62,6 @@ constexpr size_t MAX_DEPTH = 8; namespace olc::utils { - //struct geom2d::rect - //{ - // olc::vf2d pos; - // olc::vf2d size; - - // geom2d::rect(const olc::vf2d& p = { 0.0f, 0.0f }, const olc::vf2d& s = { 1.0f, 1.0f }) : pos(p), size(s) - // { - - // } - - // constexpr bool contains(const olc::vf2d& p) const - // { - // return !(p.x < pos.x || p.y < pos.y || p.x >= (pos.x + size.x) || p.y >= (pos.y + size.y)); - // } - - // constexpr bool contains(const geom2d::rect& r) const - // { - // return (r.pos.x >= pos.x) && (r.pos.x + r.size.x < pos.x + size.x) && - // (r.pos.y >= pos.y) && (r.pos.y + r.size.y < pos.y + size.y); - // } - - // constexpr bool overlaps(const geom2d::rect& r) const - // { - // return (pos.x < r.pos.x + r.size.x && pos.x + size.x >= r.pos.x && pos.y < r.pos.y + r.size.y && pos.y + size.y >= r.pos.y); - // } - //}; - template struct QuadTreeItemLocation {