tempNorm.set(h3-h1, 2, h2-h4).normalizeLocal();
tempNorm.set(h3 - h1, 2, h4 - h2).normalizeLocal();
    private void buildNormals() {        TriangleBatch batch = getBatch(0);        batch.setNormalBuffer(BufferUtils.createVector3Buffer(batch.getNormalBuffer(), batch.getVertexCount()));        Vector3f tempNorm = new Vector3f();        float h0, h1, h2, h3, h4;        int normalIndex = 0;        for (int row = 0; row < size; row++) {            for (int col = 0; col < size; col++) {                h0 = heightMap[normalIndex];                if (row == size - 1) {                    if (col == size - 1) { // last row, last col                        h1 = h4 = h0;                        h2 = heightMap[normalIndex - size];                        h3 = heightMap[normalIndex - 1];                    } else { // last row, except for last col                        h1 = heightMap[normalIndex + 1];                        h2 = heightMap[normalIndex - size];                        if (col == 0)                            h3 = h0;                        else                            h3 = heightMap[normalIndex - 1];                        h4 = h0;                    }                } else {                    if (col == size - 1) { // last column except for last row                        h1 = h0;                        if (row == 0)                            h2 = h0;                        else                             h2 = heightMap[normalIndex - size];                        h3 = heightMap[normalIndex - 1];                        h4 = heightMap[normalIndex + size];                    } else { // most cases                        h1 = heightMap[normalIndex + 1];                         if (row == 0)                             h2 = h0;                         else                             h2 = heightMap[normalIndex - size];                         if (col == 0)                             h3 = h0;                         else                             h3 = heightMap[normalIndex - 1];                         h4 = heightMap[normalIndex + size];                    }                }                tempNorm.set(h3-h1, 2, h2-h4).normalizeLocal();                BufferUtils.setInBuffer(tempNorm, batch.getNormalBuffer(), normalIndex);                normalIndex++;            }        }    }