Interface BVH<V extends Bounds2d>
A simple, immutable, quadtree-based implementation of a BVH (Bounding Volume Hierarchy) on arbitrary values implementing
Bounds2d.-
Method Summary
Modifier and TypeMethodDescriptionvoidforEachIntersecting(@NonNull Bounds2d bb, @NonNull Consumer<V> callback) Runs the given function on every value that intersects with the given bounding box.getAllIntersecting(@NonNull Bounds2d bb) Gets aListcontaining every value that intersects with the given bounding box.of(V[] values) intsize()stream()Methods inherited from interface net.buildtheearth.terraminusminus.util.bvh.Bounds2d
contains, expand, intersects, maxX, maxZ, minX, minZ, toCornerBB, toTiles, union, validateMethods inherited from interface java.lang.Iterable
forEach, iterator, spliterator
-
Method Details
-
of
-
size
int size()- Returns:
- the number of values
-
getAllIntersecting
Gets aListcontaining every value that intersects with the given bounding box.- Parameters:
bb- the bounding box that values must intersect with- Returns:
- the values
-
forEachIntersecting
Runs the given function on every value that intersects with the given bounding box.- Parameters:
bb- the bounding box that values must intersect withcallback- the callback function to run
-
stream
- See Also:
-