tinybvh-rs
Rust wrapper for tinybvh.
Features
Provides BVH (Bounding Volume Hierarchy) construction and intersection:
- Construction: [
BVH], [BVH4], [CWBVH] - Intersection
For more information about each layout: tinybvh.
Examples
BVH Wald
use ;
let primitives = vec!;
let bvh = BVHnew;
// No intersection, ray pass between the primitives
let mut ray = new;
bvh.intersect;
println!; // 1e30
// Intersects left primitive
let mut ray = new;
bvh.intersect;
println!; // 1.0 / 0
// Intersects right primitive
let mut ray = new;
bvh.intersect;
println!; // 1.0 / 1
Strided
If the vertices position are strided (located in a Vertex struct for instance),
you can enable the strided feature and use:
use ;
let vertices = ;
let positions = slice_attr!;
let bvh = BVHnew_strided;