From e285caae6df96d5fc0248f03cef5406fe49812aa Mon Sep 17 00:00:00 2001 From: "nor..67" <normen667@gmail.com> Date: Sun, 27 Nov 2011 13:50:29 +0000 Subject: [PATCH] - fix check for Nan in ShadowUtil git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@8823 75d07b2b-3a1a-0410-a2c5-0572b91ccdca --- engine/src/desktop-fx/com/jme3/shadow/ShadowUtil.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/engine/src/desktop-fx/com/jme3/shadow/ShadowUtil.java b/engine/src/desktop-fx/com/jme3/shadow/ShadowUtil.java index 24c9009cd..52512c3df 100644 --- a/engine/src/desktop-fx/com/jme3/shadow/ShadowUtil.java +++ b/engine/src/desktop-fx/com/jme3/shadow/ShadowUtil.java @@ -177,7 +177,7 @@ public class ShadowUtil { BoundingVolume vol = list.get(i).getWorldBound(); BoundingVolume newVol = vol.transform(transform); //Nehon : prevent NaN and infinity values to screw the final bounding box - if (newVol.getCenter().x != Float.NaN && newVol.getCenter().x != Float.POSITIVE_INFINITY && newVol.getCenter().x != Float.NEGATIVE_INFINITY) { + if (!Float.isNaN(newVol.getCenter().x) && newVol.getCenter().x != Float.POSITIVE_INFINITY && newVol.getCenter().x != Float.NEGATIVE_INFINITY) { bbox.mergeLocal(newVol); } } @@ -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 (store.getCenter().x != Float.NaN && store.getCenter().x != Float.POSITIVE_INFINITY && store.getCenter().x != Float.NEGATIVE_INFINITY) { + if (!Float.isNaN(store.getCenter().x) && store.getCenter().x != Float.POSITIVE_INFINITY && store.getCenter().x != Float.NEGATIVE_INFINITY) { bbox.mergeLocal(store); } }