Created abbreviations for common geometry types

This commit is contained in:
bijan2005 2021-01-23 23:27:54 -05:00
parent ed6e84a240
commit 07445dd4be
8 changed files with 70 additions and 57 deletions

View file

@ -18,8 +18,8 @@ fn trace(ray: Ray, objects: &Vec<Object>) -> Option<(&Object, f32)> {
pub fn cast_ray(ray: Ray, scene: &Scene) -> Color {
if let Some((obj, dist)) = trace(ray, &scene.objects) {
let point = ray.project(dist);
obj.getcolor(point)
let surface_color = obj.getcolor(point);
surface_color
}
else { scene.background }
}