diff --git a/pathtracer/src/render/pathtrace/mod.rs b/pathtracer/src/render/pathtrace/mod.rs index dd2cbdd..5f3e759 100644 --- a/pathtracer/src/render/pathtrace/mod.rs +++ b/pathtracer/src/render/pathtrace/mod.rs @@ -1,2 +1,4 @@ +mod path; + mod pathtracer; pub use self::pathtracer::*; diff --git a/pathtracer/src/render/pathtrace/path.rs b/pathtracer/src/render/pathtrace/path.rs new file mode 100644 index 0000000..28da0d4 --- /dev/null +++ b/pathtracer/src/render/pathtrace/path.rs @@ -0,0 +1,44 @@ +use crate::core::LightProperties; +use crate::{Point, Vector}; +use nalgebra::Unit; + +pub struct PathPoint { + pub point: Point, + pub incident: Unit, + pub normal: Unit, + pub properties: LightProperties, +} + +impl PathPoint { + pub fn new( + point: Point, + incident: Unit, + normal: Unit, + properties: LightProperties, + ) -> Self { + PathPoint { + point, + incident, + normal, + properties, + } + } +} + +pub struct Path { + pub origin: Point, + pub points: Vec, +} + +impl Path { + pub fn new(origin: Point) -> Self { + Path { + origin, + points: Vec::new(), + } + } + + pub fn push_point(&mut self, new_point: PathPoint) { + self.points.push(new_point) + } +}