Interface for TerrainBlock / TerrainPage


I think it would be useful to have a Terrain interface that TerrainPage and TerrainBlock could implement. A lot of signatures are identical in both impl.

the interface would be:

public interface Terrain {
    public int getType();
    public void setDetailTexture(int unit, int repeat);
    public float getHeight(Vector2f position);
    public float getHeight(Vector3f position);
    public float getHeight(float x, float z);
    public float getHeightFromWorld(Vector3f position);
    public Vector3f getSurfaceNormal(Vector2f position, Vector3f store);
    public Vector3f getSurfaceNormal(Vector3f position, Vector3f store)
    public Vector3f getSurfaceNormal(float x, float z, Vector3f store);
    public float getOffsetAmount();
    public Vector3f getStepScale();
    public int getTotalSize();
    public int getSize();
    public Vector2f getOffset();
    public void setOffset(Vector2f offset);
    public void setSize(int size);
    public void setTotalSize(int totalSize);
    public void setStepScale(Vector3f stepScale);
    public void setOffsetAmount(float offsetAmount);
    public void updateFromHeightMap();
    public void setHeightMapValue(int x, int y, int newVal);
    public void addHeightMapValue(int x, int y, int toAdd);
    public void multHeightMapValue(int x, int y, int toMult);
    public short getQuadrant();
    public void setQuadrant(short quadrant);
    public void write(JMEExporter e) throws IOException;
    public void read(JMEImporter e) throws IOException;

I think it should be inserted in jme framework, and that TerrainPage and TerrainBlock should add implements Terrain

IMHO it should be:

public interface Terrain extends Savable {