findIntersectingPairs

fun findIntersectingPairs(a: BVHNode2D, b: BVHNode2D, result: MutableList<Pair<Int, Int>> = mutableListOf()): List<Pair<Int, Int>>(source)

Finds and collects pairs of intersecting leaf-nodes between two bipartite sets

Return

A list of pairs of indices representing intersecting bounding volumes.

Parameters

a

The first BVHNode2D tree to check for intersections.

b

The second BVHNode2D tree to check for intersections.

result

A mutable list where intersecting pairs of indices will be added. Defaults to an empty mutable list.


Finds all intersecting pairs of leaf nodes in a 2D Bounding Volume Hierarchy (BVH).

This function traverses the provided BVH tree and identifies pairs of leaf nodes whose bounding rectangles intersect. The pairs are returned as a list of index pairs.

Return

A list of pairs of integers representing the indices of intersecting leaf nodes in the BVH.

Parameters

root

The root node of the 2D BVH tree to process.