From ec1ee394a9c73116107e6bf7ce845495074839be Mon Sep 17 00:00:00 2001 From: Matthew Gordon Date: Fri, 24 Apr 2020 00:32:16 -0400 Subject: [PATCH] Add documentation for BoundingVolumeHierarchy --- src/raycasting/bounding_volume_hierarchy.rs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/raycasting/bounding_volume_hierarchy.rs b/src/raycasting/bounding_volume_hierarchy.rs index dff56a5..b8337c7 100644 --- a/src/raycasting/bounding_volume_hierarchy.rs +++ b/src/raycasting/bounding_volume_hierarchy.rs @@ -8,6 +8,14 @@ use nalgebra::{convert, Point3}; 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)] pub enum BoundingVolumeHierarchy { Node {