|
j3d.org Code | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.j3d.terrain.AbstractTerrainData
org.j3d.terrain.AbstractTiledTerrainData
public abstract class AbstractTiledTerrainData
An abstract representation of the base functionality for a TerrainData implementation.
This class provides a lot of the common functionality that all implementations will require. Good to save you typing.
| Field Summary | |
|---|---|
protected int |
gridPointsPerTile
The number of grid points per tile. |
protected TextureTileGenerator |
tileGenerator
Reference to the currently set texture tile generator |
| Fields inherited from class org.j3d.terrain.AbstractTerrainData |
|---|
colorAvailable, gridStepX, gridStepY, textureAvailable |
| Fields inherited from interface org.j3d.terrain.TerrainData |
|---|
FREEFORM_DATA, STATIC_DATA, TILED_DATA |
| Constructor Summary | |
|---|---|
protected |
AbstractTiledTerrainData()
Create a new instance.of this data class with all flags set to false. |
| Method Summary | |
|---|---|
protected int |
convertGridToTileCoord(int grid)
Convenience method to convert the grid coordinate to the tile that it belongs in. |
protected int |
convertTileToGridCoord(int tile)
Convenience method to convert the tile coordinate to a grid coordinate |
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. |
int |
getTileSize()
Get the number of grid points along one side of a single tile. |
void |
setTextureTileGenerator(TextureTileGenerator gen)
Set the texture tile geneattor instance to the new value. |
| Methods inherited from class org.j3d.terrain.AbstractTerrainData |
|---|
getGridXStep, getGridYStep, getSourceDataType, hasColor, hasTexture |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface org.j3d.terrain.TiledTerrainData |
|---|
getTilesAvailableBounds, setActiveBounds |
| 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 |
| Field Detail |
|---|
protected TextureTileGenerator tileGenerator
protected int gridPointsPerTile
| Constructor Detail |
|---|
protected AbstractTiledTerrainData()
| Method Detail |
|---|
public int getTileSize()
getTileSize in interface TiledTerrainData
public java.awt.image.BufferedImage getTexture(int tileX,
int tileY)
getTexture in interface TiledTerrainDatatileX - the x coordinate of the tile number for the texturetileY - the y coordinate of the tile number for the texture
public void setTextureTileGenerator(TextureTileGenerator gen)
gen - The new generator instance to useprotected int convertTileToGridCoord(int tile)
tile - The tile coordinate
protected int convertGridToTileCoord(int grid)
grid - The grid coordinate
|
j3d.org Code | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||