Jelajahi Sumber

add check in lod control for camera existence when it can be empty in the sdk

git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@10591 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
bre..om 12 tahun lalu
induk
melakukan
7c966572f1

+ 2 - 0
engine/src/terrain/com/jme3/terrain/geomipmap/lodcalc/DistanceLodCalculator.java

@@ -63,6 +63,8 @@ public class DistanceLodCalculator implements LodCalculator {
     }
     
     public boolean calculateLod(TerrainPatch terrainPatch, List<Vector3f> locations, HashMap<String, UpdatedTerrainPatch> updates) {
+        if (locations == null || locations.isEmpty())
+            return false;// no camera yet
         float distance = getCenterLocation(terrainPatch).distance(locations.get(0));
 
         if (turnOffLod) {