Expand description
Trait Implementations
sourceimpl BoundingHierarchy for FlatBVH
impl BoundingHierarchy for FlatBVH
sourcefn traverse<'a, T: Bounded>(&'a self, ray: &Ray, shapes: &'a [T]) -> Vec<&'_ T>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A>where
A: Allocator,
fn traverse<'a, T: Bounded>(&'a self, ray: &Ray, shapes: &'a [T]) -> Vec<&'_ T>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A>where
A: Allocator,
A: Allocator,
Traverses a FlatBVH
structure iteratively.
Examples
use bvh::aabb::{AABB, Bounded};
use bvh::bounding_hierarchy::BoundingHierarchy;
use bvh::flat_bvh::FlatBVH;
use bvh::nalgebra::{Point3, Vector3};
use bvh::ray::Ray;
let origin = Point3::new(0.0,0.0,0.0);
let direction = Vector3::new(1.0,0.0,0.0);
let ray = Ray::new(origin, direction);
let mut shapes = create_bhshapes();
let flat_bvh = FlatBVH::build(&mut shapes);
let hit_shapes = flat_bvh.traverse(&ray, &shapes);
sourcefn pretty_print(&self)
fn pretty_print(&self)
Prints a textual representation of a FlatBVH
.