BVHNode2D

class BVHNode2D(var bounds: Rectangle = Rectangle.EMPTY, var left: BVHNode2D? = null, var right: BVHNode2D? = null, var index: Int = -1)(source)

Constructors

Link copied to clipboard
constructor(bounds: Rectangle = Rectangle.EMPTY, left: BVHNode2D? = null, right: BVHNode2D? = null, index: Int = -1)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
var bounds: Rectangle
Link copied to clipboard
var index: Int
Link copied to clipboard
Link copied to clipboard

Functions

Link copied to clipboard
fun queryPoint(point: Vector2, result: MutableList<Int> = mutableListOf()): MutableList<Int>

Queries the tree for all objects that contain the specified point.

Link copied to clipboard
fun queryRectangle(rectangle: Rectangle, result: MutableList<Int> = mutableListOf()): MutableList<Int>

Queries the tree for all objects that intersect with the given rectangle.

Link copied to clipboard
fun <T> refit(objects: List<T>, mapper: (T) -> Rectangle): Rectangle

Updates the bounding volumes of the nodes by recalculating the bounds based on the provided objects.