Removed pixels

Finished raytracer
Reimplementing imgui
This commit is contained in:
STP
2023-11-15 16:56:19 -05:00
parent 2e69164dde
commit 80fcc6c8bc
8 changed files with 1159 additions and 658 deletions

View File

@@ -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)),
}
}
}