Skip to content

Latest commit

 

History

History
33 lines (22 loc) · 904 Bytes

README.md

File metadata and controls

33 lines (22 loc) · 904 Bytes

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

source code

DemoQuadTree01Kt

DemoQuadTree02

source code

DemoQuadTree02Kt