From 92c92767849a9290dc06f59dfd4167338908ea7f Mon Sep 17 00:00:00 2001 From: Kensuke Matsuzaki Date: Fri, 8 Feb 2013 15:19:39 +0900 Subject: [PATCH] Fixed infinite loop in bih caused by small triangle. --- src/org/sunflow/core/accel/BoundingIntervalHierarchy.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/org/sunflow/core/accel/BoundingIntervalHierarchy.java b/src/org/sunflow/core/accel/BoundingIntervalHierarchy.java index 6335006..b05cd9e 100644 --- a/src/org/sunflow/core/accel/BoundingIntervalHierarchy.java +++ b/src/org/sunflow/core/accel/BoundingIntervalHierarchy.java @@ -256,7 +256,7 @@ else if (d[1] > d[2]) // ensure we are making progress in the subdivision if (right == rightOrig) { // all left - if (clipL <= split) { + if (clipL <= split && gridBox[2 * axis + 1] != split) { // keep looping on left half gridBox[2 * axis + 1] = split; prevClip = clipL; @@ -274,7 +274,7 @@ else if (d[1] > d[2]) } else if (left > right) { // all right right = rightOrig; - if (clipR >= split) { + if (clipR >= split && gridBox[2 * axis + 0] != split) { // keep looping on right half gridBox[2 * axis + 0] = split; prevClip = clipR;