protected void setHeight(List<LocationHeight> locationHeights, boolean overrideHeight) {

        final float[] heightArray = geomap.getHeightArray();
        final VertexBuffer vertexBuffer = mesh.getBuffer(Type.Position);
        final FloatBuffer floatBuffer = mesh.getFloatBuffer(Type.Position);

        for (LocationHeight lh : locationHeights) {

            if (lh.x < 0 || lh.z < 0 || lh.x >= size || lh.z >= size) {
                continue;
            }

            int idx = lh.z * size + lh.x;

            if (overrideHeight) {
                heightArray[idx] = lh.h;
            } else {
                float currentHeight = floatBuffer.get(idx * 3 + 1);
                heightArray[idx] = currentHeight + lh.h;
            }
        }

        floatBuffer.clear();
        geomap.writeVertexArray(floatBuffer, stepScale, false);
        vertexBuffer.setUpdateNeeded();
    }
Get the triangles at the specified grid point. Probably only 2 triangles
@param x local to the terrain patch
@param z local to the terrain patch
@return the triangles in world coordinates, or null if the point does intersect this patch on the XZ axis
jme3-terrain/src/main/java/com/jme3/terrain/geomipmap/TerrainPatch.java