WIP: library: render: pathtrace: add Path struct
This commit is contained in:
parent
a200a839b6
commit
6d0de72e57
|
@ -1,2 +1,4 @@
|
|||
mod path;
|
||||
|
||||
mod pathtracer;
|
||||
pub use self::pathtracer::*;
|
||||
|
|
44
pathtracer/src/render/pathtrace/path.rs
Normal file
44
pathtracer/src/render/pathtrace/path.rs
Normal file
|
@ -0,0 +1,44 @@
|
|||
use crate::core::LightProperties;
|
||||
use crate::{Point, Vector};
|
||||
use nalgebra::Unit;
|
||||
|
||||
pub struct PathPoint {
|
||||
pub point: Point,
|
||||
pub incident: Unit<Vector>,
|
||||
pub normal: Unit<Vector>,
|
||||
pub properties: LightProperties,
|
||||
}
|
||||
|
||||
impl PathPoint {
|
||||
pub fn new(
|
||||
point: Point,
|
||||
incident: Unit<Vector>,
|
||||
normal: Unit<Vector>,
|
||||
properties: LightProperties,
|
||||
) -> Self {
|
||||
PathPoint {
|
||||
point,
|
||||
incident,
|
||||
normal,
|
||||
properties,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
pub struct Path {
|
||||
pub origin: Point,
|
||||
pub points: Vec<PathPoint>,
|
||||
}
|
||||
|
||||
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)
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue