Skip to content

Latest commit

 

History

History
 
 

orx-quadtree

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 

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