aboutsummaryrefslogtreecommitdiff
path: root/src/world/mod.rs
blob: ef239db900d7acfade7e419676b8d61b996e901c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
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,
        }
    }
}