|
j3d.org Code | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface TiledTerrainData
Representatoin of data source that holds its data in tiles.
A tiled source is used to represent large amounts of data, that is not all held in memory at once. It may be held by the terrain data representation but the terrain renderer only access pieces by tile.
Because the terrain height is tiled, the assumption is that that the textures are tiled too. A single image is too large to handle the entire data set. The texture object will be queried for each patch that we are working with.
The implementation of this data set works on a modal-style basis. You can
ask the data for tile information so that the rendering will optimise for
that data access size. As part of this, it also works in an additional
coordinate system - tile coordinates. Tile have their own coordinate system
that describes tiles in their own X, Y system that overlays a point. Grid X
and Y are still relative to the overall terrain patch, we just use tile
coords to make it easier to make sure references to data areas use whole
tile information and not parts of them.
TerrainData.getSourceDataType()
always returns
TerrainData.TILED_DATA
.
Field Summary |
---|
Fields inherited from interface org.j3d.terrain.TerrainData |
---|
FREEFORM_DATA, STATIC_DATA, TILED_DATA |
Method Summary | |
---|---|
java.awt.image.BufferedImage |
getTexture(int tileX,
int tileY)
Fetch the texture or part of a texture that can be applied to the sub-region of the overall object. |
void |
getTilesAvailableBounds(java.awt.Rectangle bounds)
Fetch the area, in tile coordinates of the area that is currently available in memory. |
int |
getTileSize()
Get the number of grid points along one side of a single tile. |
void |
setActiveBounds(java.awt.Rectangle bounds)
Set the bounding information, in number of tiles, of the area that the terrain rendering code will be limiting its access to. |
Methods inherited from interface org.j3d.terrain.TerrainData |
---|
getCoordinate, getCoordinate, getCoordinateWithColor, getCoordinateWithTexture, getGridXStep, getGridYStep, getHeightFromGrid, getSourceDataType, hasColor, hasTexture |
Methods inherited from interface org.j3d.ui.navigation.HeightDataSource |
---|
getHeight |
Method Detail |
---|
java.awt.image.BufferedImage getTexture(int tileX, int tileY)
tileX
- the x coordinate of the tile number for the texturetileY
- the y coordinate of the tile number for the texture
int getTileSize()
void getTilesAvailableBounds(java.awt.Rectangle bounds)
The implementation should fill in the passed rectangle with the bounds information. The bounds are inclusive, so if the implementation of this interface provides the value of {0, 0, 2, 2} this will indicate a 3x3 area is available.
bounds
- The bounds of the available data, to be filled in by the
implementation of this classvoid setActiveBounds(java.awt.Rectangle bounds)
The values passes are inclusive tile values. A bounds of {0, 0, 1, 1} would be a 2x2 set of tiles.
bounds
- The bounds of the area, in tile coordinates, that will be
accessed
|
j3d.org Code | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |