Interface TerrainSource

All Known Implementing Classes:
ArrayTerrainSource, InMemoryTerrainSource, ProceduralTerrainSource, SimpleArrayTerrainSource

public interface TerrainSource
Feeds terrain data to a TerrainCache
  • Method Summary

    Modifier and Type
    Method
    Description
    Called to initialize and setup the geometry clipmap terrain.
    int
    getContributorId(int clipmapLevel, Tile tile)
    Returns the contributing source id for the requested tile.
    getInvalidTiles(int clipmapLevel, int tileX, int tileY, int numTilesX, int numTilesY)
    Returns which tiles that should be marked as invalid and updated in the requested region.
    float[]
    getTile(int clipmapLevel, Tile tile)
    Request for height data for a tile.
    getValidTiles(int clipmapLevel, int tileX, int tileY, int numTilesX, int numTilesY)
    Returns which tiles that contain data in the requested region.
  • Method Details

    • getConfiguration

      TerrainConfiguration getConfiguration() throws Exception
      Called to initialize and setup the geometry clipmap terrain.
      Returns:
      TerrainConfiguration
      Throws:
      Exception - exception
    • getValidTiles

      Set<Tile> getValidTiles(int clipmapLevel, int tileX, int tileY, int numTilesX, int numTilesY) throws Exception
      Returns which tiles that contain data in the requested region.
      Parameters:
      clipmapLevel - the clipmap level
      tileX - the abscissa of the tile
      tileY - the ordinate of the tile
      numTilesX - the number of tiles on X
      numTilesY - the number of tiles on Y
      Returns:
      the tiles that contain data in the requested region
      Throws:
      Exception - exception
    • getInvalidTiles

      Set<Tile> getInvalidTiles(int clipmapLevel, int tileX, int tileY, int numTilesX, int numTilesY) throws Exception
      Returns which tiles that should be marked as invalid and updated in the requested region.
      Parameters:
      clipmapLevel - the clipmap level
      tileX - the abscissa of the tile
      tileY - the ordinate of the tile
      numTilesX - the number of tiles on X
      numTilesY - the number of tiles on Y
      Returns:
      the tiles that should be marked as invalid and updated in the requested region
      Throws:
      Exception - exception
    • getContributorId

      int getContributorId(int clipmapLevel, Tile tile)
      Returns the contributing source id for the requested tile.
      Parameters:
      clipmapLevel - the clipmap level
      tile - the tile
      Returns:
      the contributor identifier
    • getTile

      float[] getTile(int clipmapLevel, Tile tile) throws Exception
      Request for height data for a tile.
      Parameters:
      clipmapLevel - the clipmap level
      tile - the tile
      Returns:
      the height data for this tile
      Throws:
      Exception - exception