diff --git a/engine/src/terrain/com/jme3/terrain/geomipmap/TerrainPatch.java b/engine/src/terrain/com/jme3/terrain/geomipmap/TerrainPatch.java index a5c4e576c..54979284b 100644 --- a/engine/src/terrain/com/jme3/terrain/geomipmap/TerrainPatch.java +++ b/engine/src/terrain/com/jme3/terrain/geomipmap/TerrainPatch.java @@ -327,19 +327,6 @@ public class TerrainPatch extends Geometry { getMesh().setBuffer(Type.Position, 3, newVertexBuffer); } - public void adjustHeight(float x, float z, float delta) { - if (x < 0 || z < 0 || x >= size || z >= size) - return; - int idx = (int) (z * size + x); - float h = getMesh().getFloatBuffer(Type.Position).get(idx*3+1); - - geomap.getHeightData().put(idx, h+delta); - - FloatBuffer newVertexBuffer = geomap.writeVertexArray(null, stepScale, false); - getMesh().clearBuffer(Type.Position); - getMesh().setBuffer(Type.Position, 3, newVertexBuffer); - } - /** * recalculate all of this normal vectors in this terrain patch */ diff --git a/engine/src/terrain/com/jme3/terrain/geomipmap/TerrainQuad.java b/engine/src/terrain/com/jme3/terrain/geomipmap/TerrainQuad.java index e9e6eb635..fbdb40891 100644 --- a/engine/src/terrain/com/jme3/terrain/geomipmap/TerrainQuad.java +++ b/engine/src/terrain/com/jme3/terrain/geomipmap/TerrainQuad.java @@ -860,8 +860,9 @@ public class TerrainQuad extends Node implements Terrain { public float getHeightmapHeight(Vector2f xz) { // offset - int x = Math.round((xz.x / getLocalScale().x) + (float)totalSize / 2f); - int z = Math.round((xz.y / getLocalScale().z) + (float)totalSize / 2f); + int halfSize = totalSize / 2; + int x = Math.round((xz.x / getLocalScale().x) + halfSize); + int z = Math.round((xz.y / getLocalScale().z) + halfSize); return getHeightmapHeight(x, z); }