aboutsummaryrefslogtreecommitdiff
path: root/src/world/mod.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/world/mod.rs')
-rw-r--r--src/world/mod.rs23
1 files changed, 23 insertions, 0 deletions
diff --git a/src/world/mod.rs b/src/world/mod.rs
new file mode 100644
index 0000000..ef239db
--- /dev/null
+++ b/src/world/mod.rs
@@ -0,0 +1,23 @@
+//! Manages world objects, and implements intersection
+pub mod shapes;
+
+mod scene;
+pub use scene::*;
+
+use std::rc::Rc;
+use crate::core::Hittable;
+use crate::material::Material;
+
+pub struct Object {
+ pub shape: Box<dyn Hittable>,
+ pub mat: Rc<dyn Material>,
+}
+
+impl Object {
+ pub fn new(mat: Rc<dyn Material>, shape: Box<dyn Hittable>) -> Self {
+ Object {
+ mat,
+ shape,
+ }
+ }
+}