BVH

class BVH<T>(val dimensions: Int, width: Int = dimensions * 3, val allowUpdateObjects: Boolean = true) : Iterable<BVH.Node<T>>

A Bounding Volume Hierarchy implementation for arbitrary dimensions. NTree - A simple n-tree structure for great results.

Constructors

Link copied to clipboard
constructor(dimensions: Int, width: Int = dimensions * 3, allowUpdateObjects: Boolean = true)

Types

Link copied to clipboard
open class Comparators
Link copied to clipboard
data class IntersectResult<T>(val ray: BVHRay, val intersect: Double, val obj: BVH.Node<T>)
Link copied to clipboard
data class Node<T>(var d: BVHRect, var id: String? = null, var nodes: FastArrayList<BVH.Node<T>>? = null, var value: T? = null)
Link copied to clipboard
class RemoveSubtreeRetObject<T>(var d: BVHRect, var target: T? = null, var nodes: FastArrayList<BVH.Node<T>>? = null)

Properties

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Functions

Link copied to clipboard
fun <T> Iterable<T>.associateByInt(block: (index: Int, value: T) -> Int): IntMap<T>
Link copied to clipboard
fun Iterable<MRectangle>.bounds(target: MRectangle = MRectangle()): MRectangle
fun Iterable<MPoint>.bounds(out: MRectangle = MRectangle(), bb: MBoundsBuilder = MBoundsBuilder()): MRectangle
Link copied to clipboard
fun debug(node: BVH.Node<T> = this.root, indentation: String = "")
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
fun insertOrUpdate(intervals: BVHIntervals, obj: T)
fun insertOrUpdate(rect: BVHRect, obj: T)
Link copied to clipboard
fun intersect(ray: BVHRay, return_array: FastArrayList<BVH.IntersectResult<T>> = fastArrayListOf()): FastArrayList<BVH.IntersectResult<T>>
Link copied to clipboard
fun intersectRay(ray: BVHIntervals, intervals: BVHRect?): BVHRect?
fun intersectRay(ray: BVHRay, intervals: BVHRect?): BVHRect?
Link copied to clipboard
Link copied to clipboard
open operator override fun iterator(): Iterator<BVH.Node<T>>
Link copied to clipboard
inline fun <T> Iterable<T>.mapDouble(callback: (T) -> Double): DoubleArrayList
Link copied to clipboard
inline fun <T> Iterable<T>.mapFloat(callback: (T) -> Float): FloatArrayList
Link copied to clipboard
inline fun <T> Iterable<T>.mapInt(callback: (T) -> Int): IntArrayList
Link copied to clipboard
fun <T> Iterable<T>.multisorted(vararg props: KProperty1<T, Comparable<*>>): List<T>
Link copied to clipboard
fun remove(obj: T)
fun remove(intervals: BVHIntervals, obj: T? = null, comparators: BVH.Comparators = Comparators): FastArrayList<BVH.Node<T>>
fun remove(rect: BVHRect, obj: T? = null, comparators: BVH.Comparators = Comparators): FastArrayList<BVH.Node<T>>
Link copied to clipboard
fun search(intervals: BVHIntervals, return_array: FastArrayList<BVH.Node<T>> = fastArrayListOf(), comparators: BVH.Comparators = Comparators): FastArrayList<BVH.Node<T>>
fun search(intervals: BVHRect, return_array: FastArrayList<BVH.Node<T>> = fastArrayListOf(), comparators: BVH.Comparators = Comparators): FastArrayList<BVH.Node<T>>
Link copied to clipboard
fun searchValues(intervals: BVHIntervals, comparators: BVH.Comparators = Comparators): List<T>
fun searchValues(rect: BVHRect, comparators: BVH.Comparators = Comparators): List<T>
Link copied to clipboard
@JvmName(name = "sumOfFloat")
inline fun <T> Iterable<T>.sumOfDouble(selector: (T) -> Double): Double
Link copied to clipboard
@JvmName(name = "sumOfFloat")
inline fun <T> Iterable<T>.sumOfFloat(selector: (T) -> Float): Float
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
fun yieldTo(intervals: BVHRect, yield_leaf: (node: BVH.Node<T>) -> Unit, yield_node: (node: BVH.Node<T>) -> Unit, root: BVH.Node<T> = this.root, comparators: BVH.Comparators = Comparators)