Removed pixels
Finished raytracer Reimplementing imgui
This commit is contained in:
38
src/scene.rs
38
src/scene.rs
@@ -2,12 +2,38 @@ use crate::camera::Camera;
|
||||
use crate::light::Light;
|
||||
use crate::primitive::Primitive;
|
||||
use nalgebra::Vector3;
|
||||
use std::sync::Arc;
|
||||
|
||||
pub struct Scene<'a> {
|
||||
pub primitives: Vec<Box<dyn Primitive<'a>>>,
|
||||
pub lights: Vec<Light>,
|
||||
pub cameras: Vec<Camera>,
|
||||
pub ambient_light: Vector3<f32>,
|
||||
pub struct Scene {
|
||||
pub primitives: Vec<Arc<dyn Primitive>>,
|
||||
pub lights: Vec<Arc<Light>>,
|
||||
pub cameras: Vec<Arc<Camera>>,
|
||||
pub ambient_light: Arc<Vector3<f32>>,
|
||||
}
|
||||
|
||||
impl<'a> Scene<'a> {}
|
||||
impl Scene {
|
||||
// Creates a new Scene with given parameters
|
||||
pub fn new(
|
||||
primitives: Vec<Arc<dyn Primitive>>,
|
||||
lights: Vec<Arc<Light>>,
|
||||
cameras: Vec<Arc<Camera>>,
|
||||
ambient_light: Arc<Vector3<f32>>,
|
||||
) -> Self {
|
||||
Scene {
|
||||
primitives,
|
||||
lights,
|
||||
cameras,
|
||||
ambient_light,
|
||||
}
|
||||
}
|
||||
|
||||
// Creates an empty Scene with default values
|
||||
pub fn empty() -> Self {
|
||||
Scene {
|
||||
primitives: Vec::new(),
|
||||
lights: Vec::new(),
|
||||
cameras: Vec::new(),
|
||||
ambient_light: Arc::new(Vector3::new(0.0, 0.0, 0.0)),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user