fully restructure quad tree from one that holds overlapping items in parent nodes, into one that holds overlapping items in each quadrant instead

This commit is contained in:
2025-01-27 06:04:52 +00:00
parent b7a609b447
commit 42b42220d0
3 changed files with 286 additions and 369 deletions

View File

@@ -71,12 +71,9 @@ struct
, tree: QuadTreeType.t
) =
case tree of
NODE {topLeft, topRight, bottomLeft, bottomRight, elements} =>
NODE {topLeft, topRight, bottomLeft, bottomRight} =>
let
(* fold over intersecting elements in this vector first *)
val state = foldVec
(itemX, itemY, itemW, itemH, 0, elements, state, env)
val halfW = quadW div 2
val halfH = quadH div 2