public abstract class AbstractFreeFormTerrainData extends AbstractTerrainData implements FreeFormTerrainData
This implementation provides the ability to also use an external providers of texture information.
| Modifier and Type | Field and Description |
|---|---|
protected int |
gridDepth
The number of grid points per tile in depth
|
protected int |
gridWidth
The number of grid points per tile in width
|
protected TextureTileGenerator |
tileGenerator
Reference to the currently set texture tile generator
|
colorAvailable, gridStepX, gridStepY, textureAvailableFREEFORM_DATA, STATIC_DATA, TILED_DATA| Modifier | Constructor and Description |
|---|---|
protected |
AbstractFreeFormTerrainData()
Create a new instance.of this data class with all flags set to false.
|
| Modifier and Type | Method and Description |
|---|---|
int |
getGridDepth()
Get the total depth (number of points on the X axis) of the grid.
|
int |
getGridWidth()
Get the total width (number of points on the Y axis) of the grid.
|
BufferedImage |
getTexture(Rectangle bounds)
Fetch the texture or part of a texture that can be applied to the
sub-region of the overall object.
|
void |
setTextureTileGenerator(TextureTileGenerator gen)
Set the texture tile geneattor instance to the new value.
|
getGridXStep, getGridYStep, getSourceDataType, hasColor, hasTextureclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetCoordinate, getCoordinate, getCoordinateWithColor, getCoordinateWithTexture, getGridXStep, getGridYStep, getHeightFromGrid, getSourceDataType, hasColor, hasTexturegetHeightprotected TextureTileGenerator tileGenerator
protected int gridWidth
protected int gridDepth
protected AbstractFreeFormTerrainData()
public int getGridWidth()
getGridWidth in interface FreeFormTerrainDatapublic int getGridDepth()
getGridDepth in interface FreeFormTerrainDatapublic BufferedImage getTexture(Rectangle bounds)
If the texture object only covers parts of the bounds, that is fine. Just return the full object and make sure the texture coordinates and texture attributes are correctly set up.
getTexture in interface FreeFormTerrainDatabounds - The bounds of the region based on the grid positionspublic void setTextureTileGenerator(TextureTileGenerator gen)
gen - The new generator instance to use
Copyright © 2001 - 2015 j3d.org