Created abbreviations for common geometry types
This commit is contained in:
parent
ed6e84a240
commit
07445dd4be
8 changed files with 70 additions and 57 deletions
|
|
@ -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 }
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue