public interface TerrainData extends HeightDataSource
The dataset is represented as a regular grid of heights which use the carto-based notion of the ground being the X-Y plane, rather than the 3D graphics convention of X-Z. In all cases, the access to this data is assumed to be in a grid pattern. If the source data comes from non-uniform sources, such as spot heights, then it will need to be accessible/interpolated to fit the grid nature of the access routines.
Note: You should never directly implement this interface. It is expected by the rendering algorithms that one of the derived types will always be used.
| Modifier and Type | Field and Description |
|---|---|
static int |
FREEFORM_DATA
The source data comes in free-form data that may be accessed any way
that the terrain rendering algorithm likes.
|
static int |
STATIC_DATA
The source data type is a simple, static terrain
|
static int |
TILED_DATA
The source data comes in the form of tiles that may be dynamically
loaded.
|
| Modifier and Type | Method and Description |
|---|---|
void |
getCoordinate(float[] coord,
float[] tex,
float[] color,
int gridX,
int gridY)
Get the coordinate with all the information - texture and colors.
|
void |
getCoordinate(float[] coord,
int gridX,
int gridY)
Get the coordinate of the point in the grid.
|
void |
getCoordinateWithColor(float[] coord,
float[] color,
int gridX,
int gridY)
Get the coordinate of the point and the corresponding color value in
the grid.
|
void |
getCoordinateWithTexture(float[] coord,
float[] tex,
int gridX,
int gridY,
int patchX,
int patchY)
Get the coordinate of the point and corresponding texture coordinate in
the grid.
|
double |
getGridXStep()
Get the real world distance between consecutive X values in the grid.
|
double |
getGridYStep()
Get the real world distance between consecutive Y values in the grid.
|
float |
getHeightFromGrid(int gridX,
int gridY)
Get the height at the specified grid position.
|
int |
getSourceDataType()
Get the type of terrain data that we are dealing with.
|
boolean |
hasColor()
Check to see if this terrain data has per-vertex colours.
|
boolean |
hasTexture()
Check to see if this terrain data has any texturing at all - either
tiled or simple.
|
getHeightstatic final int STATIC_DATA
static final int TILED_DATA
static final int FREEFORM_DATA
int getSourceDataType()
instanceofvoid getCoordinate(float[] coord,
int gridX,
int gridY)
coord - the x, y, and z coordinates will be placed in the
first three elements of the array.gridX - The X coordinate of the position in the gridgridY - The Y coordinate of the position in the gridvoid getCoordinate(float[] coord,
float[] tex,
float[] color,
int gridX,
int gridY)
coord - he x, y, and z coordinates will be placed in the first
three elements of the array.tex - 2D coordinates are placed in the first two elementscolor - 3 component colors are placed in the first 3 elementsgridX - The X coordinate of the position in the gridgridY - The Y coordinate of the position in the gridvoid getCoordinateWithTexture(float[] coord,
float[] tex,
int gridX,
int gridY,
int patchX,
int patchY)
coord - he x, y, and z coordinates will be placed in the first
three elements of the array.tex - 2D coordinates are placed in the first two elementsgridX - The X coordinate of the position in the gridgridY - The Y coordinate of the position in the gridvoid getCoordinateWithColor(float[] coord,
float[] color,
int gridX,
int gridY)
coord - he x, y, and z coordinates will be placed in the first
three elements of the array.color - 3 component colors are placed in the first 3 elementsgridX - The X coordinate of the position in the gridgridY - The Y coordinate of the position in the gridboolean hasColor()
boolean hasTexture()
float getHeightFromGrid(int gridX,
int gridY)
gridX - The X coordinate of the position in the gridgridY - The Y coordinate of the position in the griddouble getGridXStep()
double getGridYStep()
Copyright © 2001 - 2015 j3d.org