aboutsummaryrefslogtreecommitdiff
path: root/src/world/mod.rs
diff options
context:
space:
mode:
authorJulian T <julian@jtle.dk>2021-02-10 23:06:48 +0100
committerJulian T <julian@jtle.dk>2021-02-10 23:06:48 +0100
commit49c6adb0db70ffc30eaac33b66eacf7574b34e26 (patch)
tree60f828ce8abf962fe2d88fdeb4e04db1d7663253 /src/world/mod.rs
parent3a144c8c1fc83150fc06d792082db5cc4bce3cc5 (diff)
Fixed most clippy warnings
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,
+ }
+ }
+}