public FloatBuffer writeTexCoordArray(FloatBuffer store, Vector2f offset, Vector2f scale, float offsetAmount, int totalSize) {
        if (store != null) {
            if (store.remaining() < getWidth() * getHeight() * 2) {
                throw new BufferUnderflowException();
            }
        } else {
            store = BufferUtils.createFloatBuffer(getWidth() * getHeight() * 2);
        }

        if (offset == null) {
            offset = new Vector2f();
        }

        Vector2f tcStore = new Vector2f();

        // work from bottom of heightmap up, so we don't flip the coords
        for (int y = getHeight() - 1; y >= 0; y--) {
            for (int x = 0; x < getWidth(); x++) {
                getUV(x, y, tcStore, offset, offsetAmount, totalSize);
                float tx = tcStore.x * scale.x;
                float ty = tcStore.y * scale.y;
                store.put(tx);
                store.put(ty);
            }
        }

        return store;
    }
Produces the mesh for the TerrainPatch.
This LOD algorithm generates a single triangle strip by first building the center of the
mesh, minus one outer edge around it. Then it builds the edges in counter-clockwise order,
starting at the bottom right and working up, then left across the top, then down across the
left, then right across the bottom.
It needs to know what its neighbour's LODs are, so it can stitch the edges.
It creates degenerate polygons in order to keep the winding order of the polygons and to move
the strip to a new position while still maintaining the continuity of the overall mesh. These
degenerates are removed quickly by the video card.

@author Brent Owens
jme3-terrain/src/main/java/com/jme3/terrain/geomipmap/LODGeomap.java