From 3ef8f4d918406eec6bdc29e0ebd883fabfac9b2e Mon Sep 17 00:00:00 2001 From: Julian T Date: Thu, 5 Aug 2021 15:44:40 +0200 Subject: Add picture for c5505ab84820248c6dba35fc06aef9e0ced183de --- src/world/scene.rs | 43 ------------------------------------------- 1 file changed, 43 deletions(-) delete mode 100644 src/world/scene.rs (limited to 'src/world/scene.rs') diff --git a/src/world/scene.rs b/src/world/scene.rs deleted file mode 100644 index 87bec1f..0000000 --- a/src/world/scene.rs +++ /dev/null @@ -1,43 +0,0 @@ -use crate::core::{Bound3f, Ray}; - -use super::{Object, container, Hittable, Intersection}; - -type Container = container::HittableList; - -pub struct Scene { - content: Container, -} - -impl Scene { - pub fn new() -> Self { - Self::default() - } - - pub fn add_object(&mut self, obj: Object) { - self.content.add(obj); - } - - pub fn add_objects(&mut self, objs: Vec) { - for obj in objs { - self.add_object(obj); - } - } -} - -impl Hittable for Scene { - fn intersect(&self, ray: &Ray) -> Option { - self.content.intersect(ray) - } - - fn bounding_box(&self) -> Bound3f { - self.content.bounding_box() - } -} - -impl Default for Scene { - fn default() -> Self { - Self { - content: Container::new(), - } - } -} -- cgit v1.2.3