ReadwriteQuadtree

Wraps a quadtree with a ReentrantReadWriteLock, which allows multiple concurrent readers or one writer at a time.

Constructors

Link copied to clipboard
constructor(qt: Quadtree<T>)

Properties

Link copied to clipboard
Link copied to clipboard
val qt: Quadtree<T>

Functions

Link copied to clipboard
open override fun clear()

Clears the whole tree

Link copied to clipboard
open override fun findNode(element: T): Quadtree<T>?

Finds which node the element is within (but not necessarily belonging to)

Link copied to clipboard
open override fun insert(element: T): Boolean

Inserts the element in the appropriate node

Link copied to clipboard
open override fun nearest(element: T, radius: Double): QuadtreeQuery<T>?

Finds the nearest and neighbouring points within a radius

Link copied to clipboard
open override fun nearestToPoint(point: Vector2, radius: Double): QuadtreeQuery<T>?

Finds the nearest and neighbouring objects within a radius (needs to have a different name so there is no ambiguity when the generic object type is Vector2)

Link copied to clipboard
open override fun remove(element: T): Boolean

Remove the given element