psychopath/src/surface/mod.rs
Nathan Vegdahl f4445417dc Reorganizing the module tree.
Enough things had accumulated that it seemed to make sense to
group some stuff together.  So here it is.
2017-02-14 00:14:08 -08:00

35 lines
757 B
Rust

#![allow(dead_code)]
mod triangle;
pub mod triangle_mesh;
use std::fmt::Debug;
use boundable::Boundable;
use math::{Point, Vector, Normal, Matrix4x4};
use ray::{Ray, AccelRay};
use shading::surface_closure::SurfaceClosureUnion;
#[derive(Debug, Copy, Clone)]
pub enum SurfaceIntersection {
Miss,
Occlude,
Hit {
t: f32,
pos: Point,
incoming: Vector,
nor: Normal,
local_space: Matrix4x4,
closure: SurfaceClosureUnion,
},
}
pub trait Surface: Boundable + Debug + Sync {
fn intersect_rays(&self,
accel_rays: &mut [AccelRay],
wrays: &[Ray],
isects: &mut [SurfaceIntersection],
space: &[Matrix4x4]);
}