public interface FreeFormTerrainData extends TerrainData
The source data provided by this dataset is assumed to contain a large amount of some form of memory-managed data. The nanagement routines do not really care about how the terrain is accessed. However, the implementation can expect some form of locality of reference access to the data. Terrain rendering algorithms don't randomly access the data, so it is safe to assume that at least some form of caching can be done and expect near neighbouts to be probably accessed very shortly.
Textures are assumed to be tiled, but that is really up to the
implementation. If the implementation does not tile the textures then
for each call to getTexture() just return the same
instance each time. Also, make sure that the texture coordinates returned
from the various getCoordinateX() methods are all coorect
for the type of texture you are using.
TerrainData.getSourceDataType() always returns
TerrainData.FREEFORM_DATA.
FREEFORM_DATA, STATIC_DATA, TILED_DATA| 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.
|
getCoordinate, getCoordinate, getCoordinateWithColor, getCoordinateWithTexture, getGridXStep, getGridYStep, getHeightFromGrid, getSourceDataType, hasColor, hasTexturegetHeightBufferedImage 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.
bounds - The bounds of the region based on the grid positionsint getGridWidth()
int getGridDepth()
Copyright © 2001 - 2015 j3d.org