diff options
author | Anthony LaTorre <tlatorre9@gmail.com> | 2011-09-11 01:39:03 -0400 |
---|---|---|
committer | Anthony LaTorre <tlatorre9@gmail.com> | 2011-09-11 01:39:03 -0400 |
commit | 9a17b5ce0489bdb60ca04b441d2c44452edfb50e (patch) | |
tree | de015da0877b80e465974f8cf203c10d788d178a /src | |
parent | 1a3dc65dd50d1cfb8ef819abbdbdf99e61b3ed0b (diff) | |
download | chroma-9a17b5ce0489bdb60ca04b441d2c44452edfb50e.tar.gz chroma-9a17b5ce0489bdb60ca04b441d2c44452edfb50e.tar.bz2 chroma-9a17b5ce0489bdb60ca04b441d2c44452edfb50e.zip |
speedup triangle intersection by reducing STACK_SIZE.
Diffstat (limited to 'src')
-rw-r--r-- | src/mesh.h | 9 |
1 files changed, 8 insertions, 1 deletions
@@ -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); |