summaryrefslogtreecommitdiff
path: root/src/mesh.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/mesh.h')
-rw-r--r--src/mesh.h9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/mesh.h b/src/mesh.h
index 73dff71..d60d801 100644
--- a/src/mesh.h
+++ b/src/mesh.h
@@ -4,7 +4,9 @@
#include "intersect.h"
#include "geometry.h"
-#define STACK_SIZE 500
+#include "stdio.h"
+
+#define STACK_SIZE 100
/* Tests the intersection between a ray and a node in the bounding volume
hierarchy. If the ray intersects the bounding volume and `min_distance`
@@ -109,6 +111,11 @@ intersect_mesh(const float3 &origin, const float3& direction, Geometry *g,
} // node is a leaf
+ if (node > tail) {
+ printf("warning: intersect_mesh() aborted; node > tail\n");
+ break;
+ }
+
} // while loop
while (node != head);