So... FINALLY have something that looks like the sketch at the end of Coding Challenge 98.2), see video code
I took a slightly different approach, passing a function in rather than points out. p5js functions are being handed in to do the drawing this way. It could use some refactoring, but I'm walking away before I break it!
- Get Every
- qTree.doWithPoints(everyPointFunction): where everyPointFunction is a function that takes a point
- qTree.doWithSubTreeInfo(treeInfoHandler): where treeInfoHandler takes in a points array (from just a leaf), the leaf's bounds, the leaf's level, quadrantPath to the leaf.
- qTree.doWithLeafBounds(boundsHandler): where boundsHandler takes in a leaf's bounds.
- Response to Bounds Query
- qTree.doWithPointsWithin(bounds, somePointsFunction): where bounds is the query range and somePointsFunction is a function that takes a point