Skip to main content

conspire/geometry/bvh/
mod.rs

1use crate::units::Length;
2mod base;
3mod from;
4mod node;
5mod primitive;
6mod ray;
7
8use crate::{geometry::bvh::node::Nodes, math::Quantity};
9
10pub struct BoundingVolumeHierarchy<const D: usize> {
11    items: Vec<usize>,
12    nodes: Nodes<D>,
13}
14
15#[derive(Clone, Debug, PartialEq)]
16pub struct Hit {
17    distance: Quantity<Length>,
18    index: usize,
19}
20
21impl Hit {
22    pub fn distance(&self) -> Quantity<Length> {
23        self.distance
24    }
25    pub fn index(&self) -> usize {
26        self.index
27    }
28}