diff --git a/engine/src/terrain/com/jme3/terrain/GeoMap.java b/engine/src/terrain/com/jme3/terrain/GeoMap.java index 630516304..15c17c225 100644 --- a/engine/src/terrain/com/jme3/terrain/GeoMap.java +++ b/engine/src/terrain/com/jme3/terrain/GeoMap.java @@ -58,7 +58,10 @@ public class GeoMap implements Savable { @Deprecated public GeoMap(FloatBuffer heightData, int width, int height, int maxval){ - this(heightData.array(), width, height, maxval); + this(new float[heightData.limit()], width, height, maxval); + this.width = width; + this.height = height; + this.maxval = maxval; } public GeoMap(float[] heightData, int width, int height, int maxval){ diff --git a/engine/src/terrain/com/jme3/terrain/geomipmap/LODGeomap.java b/engine/src/terrain/com/jme3/terrain/geomipmap/LODGeomap.java index 2096e458a..5b14f21b8 100644 --- a/engine/src/terrain/com/jme3/terrain/geomipmap/LODGeomap.java +++ b/engine/src/terrain/com/jme3/terrain/geomipmap/LODGeomap.java @@ -72,7 +72,7 @@ public class LODGeomap extends GeoMap { @Deprecated public LODGeomap(int size, FloatBuffer heightMap) { - this(size, heightMap.array()); + this(size, new float[heightMap.limit()]); } public LODGeomap(int size, float[] heightMap) {