From c41058a5a04e17e509cab24282597ed3f2490722 Mon Sep 17 00:00:00 2001 From: Kirill Vainer Date: Sun, 13 Sep 2015 22:09:20 -0400 Subject: [PATCH] spot light: fix broken filter for infinite range --- jme3-core/src/main/java/com/jme3/light/SpotLight.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/jme3-core/src/main/java/com/jme3/light/SpotLight.java b/jme3-core/src/main/java/com/jme3/light/SpotLight.java index 9b551d3d8..de24280ab 100644 --- a/jme3-core/src/main/java/com/jme3/light/SpotLight.java +++ b/jme3-core/src/main/java/com/jme3/light/SpotLight.java @@ -227,7 +227,10 @@ public class SpotLight extends Light { @Override public boolean intersectsFrustum(Camera cam, TempVars vars) { - + if (spotRange == 0) { + // The algorithm below does not support infinite spot range. + return true; + } Vector3f farPoint = vars.vect1.set(position).addLocal(vars.vect2.set(direction).multLocal(spotRange)); for (int i = 5; i >= 0; i--) { //check origin against the plane