Files
orx/orx-quadtree
2025-09-20 06:17:24 +02:00
..
2025-08-04 12:00:35 +02:00
2025-08-27 19:48:23 +00:00

orx-quadtree

A Quadtree is a spatial partioning tree structure meant to provide fast spatial queries such as nearest points within a range.

Example

val box = Rectangle.fromCenter(Vector2(400.0), 750.0)

val quadTree = Quadtree<Vector2>(box) { it }

for (point in points) {
    quadTree.insert(point)
}

val nearestQuery = quadTree.nearest(points[4], 20.0)

Author

Ricardo Matias / @ricardomatias

Demos

DemoQuadTree01

DemoQuadTree01Kt

source code

DemoQuadTree02

DemoQuadTree02Kt

source code