Add documentation for BoundingVolumeHierarchy

This commit is contained in:
Matthew Gordon 2020-04-24 00:32:16 -04:00
parent 1d9baf1f05
commit ec1ee394a9
1 changed files with 8 additions and 0 deletions

View File

@ -8,6 +8,14 @@ use nalgebra::{convert, Point3};
use std::sync::Arc; use std::sync::Arc;
/// Stores a set of [Primitives](Primitive) and accelerates raycasting
///
/// Organizes the primitives into a binary tree based on their bounds, allowing the
/// closest intersection with a ray to be found efficiently.
///
/// Each node knows the overall bounds of all it's children, which means that a ray that
/// doesn't intersect the [BoundingBox](BoundingBox) of the node doesn't intersect any of
/// the primitives stored in it's children.
#[derive(Clone)] #[derive(Clone)]
pub enum BoundingVolumeHierarchy<T: Real> { pub enum BoundingVolumeHierarchy<T: Real> {
Node { Node {