aboutsummaryrefslogtreecommitdiff
path: root/src/world/mod.rs
blob: f0ba8d207e4001185579287f744f84ad4a2cf3d2 (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::sync::Arc;
use crate::core::Hittable;
use crate::material::Material;

pub struct Object {
    pub shape: Box<dyn Hittable + Sync>,
    pub mat: Arc<dyn Material + Sync + Send>,
}

impl Object {
    pub fn new(mat: Arc<dyn Material + Sync + Send>, shape: Box<dyn Hittable + Sync>) -> Self {
        Object {
            mat,
            shape,
        }
    }
}