pathtracer/pathtracer/src/render/pathtrace/path.rs
2020-03-31 12:09:28 +02:00

45 lines
837 B
Rust

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