Overview
This is a p5.js sketch to demonstrate an implementation of a Quadtree data structure.
Specifically, this enables a type referred to as a Polygonal Map
, though limited to storing rectangles. The Quadtree
class can still store points as well, with an optional containsPoints
parameter defaulting to true
for the original implementation.
Controls
Mouse
Move
- Highlights the rectangles centered around the mouse.
Touch
Touch and Drag
- Highlights the rectangles centered around the main touch point.