ray_tracer/tree/
mod.rs

1use std::rc::Rc;
2
3use crate::float::Float;
4use crate::ray::Ray;
5use crate::hit::Hit;
6use crate::actor::Actor;
7
8pub mod linear;
9pub mod oct;
10pub mod binary;
11
12pub trait Tree<T>
13    where T: Float
14{
15    fn add_actor(&mut self, actor: Rc<Actor<T>>) -> bool;
16
17    fn get_hit(&self, ray: &Ray<T>, t_min: T, t_max: T) -> Option<(Rc<Actor<T>>, Hit<T>)>;
18}
19
20pub enum TreeType {
21    Linear,
22    Binary,
23    Oct
24}