From 64d9c6014203aa1f1f445650c67440b41ea1d6a3 Mon Sep 17 00:00:00 2001 From: "Sha..rd" Date: Mon, 9 Jan 2012 04:37:11 +0000 Subject: [PATCH] * BIHTree will exit early if ray limit is lower than the farthest collision point with the model's bound git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@9010 75d07b2b-3a1a-0410-a2c5-0572b91ccdca --- engine/src/core/com/jme3/collision/bih/BIHTree.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/engine/src/core/com/jme3/collision/bih/BIHTree.java b/engine/src/core/com/jme3/collision/bih/BIHTree.java index cbc59611a..76365e5c4 100644 --- a/engine/src/core/com/jme3/collision/bih/BIHTree.java +++ b/engine/src/core/com/jme3/collision/bih/BIHTree.java @@ -415,6 +415,9 @@ public class BIHTree implements CollisionData { if (r.getLimit() < Float.POSITIVE_INFINITY) { tMax = Math.min(tMax, r.getLimit()); + if (tMin > tMax){ + return 0; + } } // return root.intersectBrute(r, worldMatrix, this, tMin, tMax, results);