Reorder some code -- just some formatting
This commit is contained in:
parent
247e205827
commit
8a1934f957
1 changed files with 3 additions and 1 deletions
|
@ -9,6 +9,7 @@
|
|||
#include <cstdio>
|
||||
|
||||
#include "basics.h"
|
||||
#include "light.h"
|
||||
#include "object.h"
|
||||
#include "scene.h"
|
||||
#include "writer.h"
|
||||
|
@ -148,11 +149,12 @@ Scene::add_light(Light *light)
|
|||
Color
|
||||
Scene::trace_ray(const Ray &ray, const int depth)
|
||||
{
|
||||
// Find intersections of this ray with objects in the scene.
|
||||
Shape *intersected_shape = NULL;
|
||||
float *t = NULL;
|
||||
float nearest_t = INFINITY;
|
||||
int nints;
|
||||
|
||||
// Find intersections of this ray with objects in the scene.
|
||||
for (Shape *s : shapes) {
|
||||
nints = s->does_intersect(ray, &t);
|
||||
if (nints > 0) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue