ploc-bhv
A Bounding Volume Hierarchy based on PLOC. Inspired by a series of articles by Arsène Pérard-Gayot
Getting started
Creating and traversing the BVH is all done using Iterators.
In this example we create AABBs for a few boxes, and use their index as the key:
use *;
use Vec3;
...
let boxes: = generate_boxes;
let bvh = new;
Next we can simply iterate over the BVH using one of the provided methods:
let mut stack = bvh.create_stack;
let origin = ZERO;
let direction = Y;
let max_time_of_impact = 1.;
for index in bvh.cast_ray
It's recommended to reuse the stack where possible to avoid unnecessary allocations.
Future work
- Actually support the parallelization
Licensing
All code in this repository is dual-licensed under either:
- MIT License (LICENSE-MIT or http://opensource.org/licenses/MIT)
- Apache License, Version 2.0 (LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0)
at your option.