Add more scenes

This commit is contained in:
hal8174 2024-10-04 22:06:00 +02:00
parent 7d38e87f6a
commit b11e7a7a78
8 changed files with 116 additions and 20 deletions

View file

@ -19,6 +19,39 @@ pub struct BVHMaterial<R: Rng> {
pub light: Option<Box<dyn Light<R>>>,
}
impl<R: Rng> BVHMaterial<R> {
pub fn new_material<M: Material<R> + 'static>(material: M) -> Self {
Self {
material: Some(Box::new(material)),
light: None,
}
}
pub fn new_light<L: Light<R> + 'static>(light: L) -> Self {
Self {
material: None,
light: Some(Box::new(light)),
}
}
pub fn new_material_light<M: Material<R> + 'static, L: Light<R> + 'static>(
material: M,
light: L,
) -> Self {
Self {
material: Some(Box::new(material)),
light: Some(Box::new(light)),
}
}
pub fn new_empty() -> Self {
Self {
material: None,
light: None,
}
}
}
#[derive(Debug, Clone, Copy)]
enum Node {
Inner {