diff --git a/engine/src/desktop-fx/com/jme3/shadow/ShadowUtil.java b/engine/src/desktop-fx/com/jme3/shadow/ShadowUtil.java index 3a1cdd865..7260ea642 100644 --- a/engine/src/desktop-fx/com/jme3/shadow/ShadowUtil.java +++ b/engine/src/desktop-fx/com/jme3/shadow/ShadowUtil.java @@ -197,7 +197,7 @@ public class ShadowUtil { BoundingVolume vol = list.get(i).getWorldBound(); store = vol.clone().transform(mat, null); //Nehon : prevent NaN and infinity values to screw the final bounding box - if (!Float.isNaN(store.getCenter().x) && store.getCenter().x != Float.POSITIVE_INFINITY && store.getCenter().x != Float.NEGATIVE_INFINITY) { + if (!Float.isNaN(store.getCenter().x) && !Float.isInfinite(store.getCenter().x)) { bbox.mergeLocal(store); } }