Struct crystal_ball::shapes::BVH
source · pub struct BVH<S: Shape> {
pub shapes: Vec<S>,
pub nodes: Vec<LinearBVHNode>,
}
Expand description
A bounding volume hierarchy of Shape
s.
In short, this allows for much faster render times by storing the individual shapes in spatial nodes (bounding volumes). Ray intersection is then performed to determine which nodes are hit. This quickly rules out large numbers of shapes, so there don’t need to be any ray intersections against them.
The implementation is based on the PBR book.
Fields§
§shapes: Vec<S>
The BVH’s shapes.
nodes: Vec<LinearBVHNode>
The BVH’s nodes.
Implementations§
Trait Implementations§
Auto Trait Implementations§
impl<S> RefUnwindSafe for BVH<S>where
S: RefUnwindSafe,
impl<S> Send for BVH<S>
impl<S> Sync for BVH<S>
impl<S> Unpin for BVH<S>where
S: Unpin,
impl<S> UnwindSafe for BVH<S>where
S: UnwindSafe,
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more