box_intersect_ze
box_intersect_ze is a broad phase collision detection library implementing the algorithm
described in the paper Fast software for box intersections
by Afra Zomorodian and Herbert Edelsbrunner. The algorithm uses streamed segment trees, pruning and scanning.
It should be well suited for video games, where bounding boxes change frequently and any spatial data structure
kept in memory will be frequently invalidated.
The algorithm requires a random number generator. With the rand-crate
optional feature you can use
any RNG from the rand crate, or you can implement the Rng
trait for your own RNG if
you don't want the dependency.
Example
use BBoxSet;
use Box3Df32;
use ChaCha8Rng;
use SeedableRng;
// create some boxes
let box0 = new;
let box1 = new;
let box2 = new;
// add them to a BBoxSet
let mut boxes = with_capacity;
boxes.push;
boxes.push;
boxes.push;
boxes.sort; // sort it in dimension 0
// set capacity according to expected number of intersections to avoid resizing
let mut result = Vec with_capacity;
// get the intersections
intersect_ze;
assert!;
assert!;
assert!;
assert!;