From 071127cbf699f9f4143e145697120cea6599245e Mon Sep 17 00:00:00 2001 From: mallanmba Date: Wed, 27 Jan 2016 07:44:28 -0800 Subject: replace Java7 construct --- .../src/main/java/com/ardor3d/extension/model/obj/ObjExporter.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ardor3d-extras/src/main/java/com/ardor3d/extension/model/obj/ObjExporter.java b/ardor3d-extras/src/main/java/com/ardor3d/extension/model/obj/ObjExporter.java index de81d4a..033727f 100644 --- a/ardor3d-extras/src/main/java/com/ardor3d/extension/model/obj/ObjExporter.java +++ b/ardor3d-extras/src/main/java/com/ardor3d/extension/model/obj/ObjExporter.java @@ -18,7 +18,6 @@ import java.io.PrintWriter; import java.util.ArrayList; import java.util.Arrays; import java.util.List; -import java.util.Objects; import java.util.logging.Logger; import com.ardor3d.extension.model.util.KeyframeController; @@ -207,7 +206,8 @@ public class ObjExporter { && mtl.forceBlend == currentMtl.forceBlend && mtl.d == currentMtl.d && Arrays.equals(mtl.Ka, currentMtl.Ka) && Arrays.equals(mtl.Kd, currentMtl.Kd) && Arrays.equals(mtl.Ks, currentMtl.Ks) - && Objects.equals(mtl.textureName, currentMtl.textureName)) { + //&& Objects.equals(mtl.textureName, currentMtl.textureName)) { + && mtl.textureName.equals(currentMtl.textureName)) { sameObjMtl = mtl; break; } -- cgit v1.2.3 From 6f6a4aa79b7e9caaa37229a1d42a53b669fe0aad Mon Sep 17 00:00:00 2001 From: mallanmba Date: Wed, 27 Jan 2016 12:15:19 -0800 Subject: fix clipmap terrain when view moves outside original cache bounds by removing bad conditional that will always fail. --- .../extension/terrain/client/TerrainGridCache.java | 23 ++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/ardor3d-terrain/src/main/java/com/ardor3d/extension/terrain/client/TerrainGridCache.java b/ardor3d-terrain/src/main/java/com/ardor3d/extension/terrain/client/TerrainGridCache.java index 8c03bdd..fb772cc 100644 --- a/ardor3d-terrain/src/main/java/com/ardor3d/extension/terrain/client/TerrainGridCache.java +++ b/ardor3d-terrain/src/main/java/com/ardor3d/extension/terrain/client/TerrainGridCache.java @@ -296,14 +296,21 @@ public class TerrainGridCache implements TerrainCache, Runnable { int tileX = MathUtils.floor((float) x / tileSize); int tileY = MathUtils.floor((float) z / tileSize); final CacheData tileData; - final int cacheMin = -cacheSize / 2, cacheMax = cacheSize / 2 - (cacheSize % 2 == 0 ? 1 : 0); - if (tileX < cacheMin || tileX > cacheMax || tileY < cacheMin || tileY > cacheMax) { - tileData = null; - } else { - tileX = MathUtils.moduloPositive(tileX, cacheSize); - tileY = MathUtils.moduloPositive(tileY, cacheSize); - tileData = cache[tileX][tileY]; - } + // mallan - 2016-01-26: this conditional will ALWAYS fail once view has + // moved outside the origin cache bounds (tileX,tileY are source tile coordinates, + // cacheSize are desintation tile coordinates). The moduloPositive does what we need, + // this conditional breaks the terrain. + // final int cacheMin = -cacheSize / 2, cacheMax = cacheSize / 2 - (cacheSize % 2 == 0 ? 1 : 0); + // if (tileX < cacheMin || tileX > cacheMax || tileY < cacheMin || tileY > cacheMax) { + // tileData = null; + // } else { + // tileX = MathUtils.moduloPositive(tileX, cacheSize); + // tileY = MathUtils.moduloPositive(tileY, cacheSize); + // tileData = cache[tileX][tileY]; + // } + tileX = MathUtils.moduloPositive(tileX, cacheSize); + tileY = MathUtils.moduloPositive(tileY, cacheSize); + tileData = cache[tileX][tileY]; if (tileData == null || !tileData.isValid) { if (parentCache != null) { -- cgit v1.2.3