diff --git a/engine/nbproject/project.properties b/engine/nbproject/project.properties index 811e47f6b..4046053cb 100644 --- a/engine/nbproject/project.properties +++ b/engine/nbproject/project.properties @@ -86,7 +86,7 @@ platform.active=default_platform run.classpath=\ ${javac.classpath}:\ ${build.classes.dir} -run.jvmargs=-Xms30m -Xmx30m -XX:MaxDirectMemorySize=256M +run.jvmargs=-Xms128m -Xmx128m -XX:MaxDirectMemorySize=256M run.test.classpath=\ ${javac.test.classpath}:\ ${build.test.classes.dir} diff --git a/engine/src/terrain/com/jme3/terrain/geomipmap/TerrainPatch.java b/engine/src/terrain/com/jme3/terrain/geomipmap/TerrainPatch.java index 650d8b820..db34bcf10 100644 --- a/engine/src/terrain/com/jme3/terrain/geomipmap/TerrainPatch.java +++ b/engine/src/terrain/com/jme3/terrain/geomipmap/TerrainPatch.java @@ -1036,6 +1036,11 @@ public class TerrainPatch extends Geometry { @Override public void write(JmeExporter ex) throws IOException { + // the mesh is removed, and reloaded when read() is called + // this reduces the save size to 10% by not saving the mesh + Mesh temp = getMesh(); + mesh = null; + super.write(ex); OutputCapsule oc = ex.getCapsule(this); oc.write(size, "size", 16); @@ -1048,6 +1053,8 @@ public class TerrainPatch extends Geometry { oc.write(lodCalculatorFactory, "lodCalculatorFactory", null); oc.write(lodEntropy, "lodEntropy", null); oc.write(geomap, "geomap", null); + + setMesh(temp); } @Override @@ -1065,6 +1072,10 @@ public class TerrainPatch extends Geometry { lodCalculatorFactory = (LodCalculatorFactory) ic.readSavable("lodCalculatorFactory", null); lodEntropy = ic.readFloatArray("lodEntropy", null); geomap = (LODGeomap) ic.readSavable("geomap", null); + + Mesh regen = geomap.createMesh(stepScale, new Vector2f(1,1), offset, offsetAmount, totalSize, false); + setMesh(regen); + TangentBinormalGenerator.generate(this); // note that this will be removed } @Override diff --git a/engine/src/terrain/com/jme3/terrain/geomipmap/TerrainQuad.java b/engine/src/terrain/com/jme3/terrain/geomipmap/TerrainQuad.java index 41b80fbe1..7bee962d2 100644 --- a/engine/src/terrain/com/jme3/terrain/geomipmap/TerrainQuad.java +++ b/engine/src/terrain/com/jme3/terrain/geomipmap/TerrainQuad.java @@ -1520,6 +1520,12 @@ public class TerrainQuad extends Node implements Terrain { quadrant = c.readInt("quadrant", 0); totalSize = c.readInt("totalSize", 0); lodCalculatorFactory = (LodCalculatorFactory) c.readSavable("lodCalculatorFactory", null); + + if ( !(getParent() instanceof TerrainQuad) ) { + BoundingBox all = new BoundingBox(getWorldTranslation(), totalSize, totalSize, totalSize); + affectedAreaBBox = all; + updateNormals(); + } } @Override