
j3d.org Code  
PREV CLASS NEXT CLASS  FRAMES NO FRAMES  
SUMMARY: NESTED  FIELD  CONSTR  METHOD  DETAIL: FIELD  CONSTR  METHOD 
public interface TerrainData
This class provides a generic interface to the terrain dataset.
The dataset is represented as a regular grid of heights which use the cartobased notion of the ground being the XY plane, rather than the 3D graphics convention of XZ. In all cases, the access to this data is assumed to be in a grid pattern. If the source data comes from nonuniform 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.
Field Summary  

static int 
FREEFORM_DATA
The source data comes in freeform 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. 
Method Summary  

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 pervertex colours. 
boolean 
hasTexture()
Check to see if this terrain data has any texturing at all  either tiled or simple. 
Methods inherited from interface org.j3d.ui.navigation.HeightDataSource 

getHeight 
Field Detail 

static final int STATIC_DATA
static final int TILED_DATA
static final int FREEFORM_DATA
Method Detail 

int getSourceDataType()
instanceof
void 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 grid
double getGridXStep()
double getGridYStep()

j3d.org Code  
PREV CLASS NEXT CLASS  FRAMES NO FRAMES  
SUMMARY: NESTED  FIELD  CONSTR  METHOD  DETAIL: FIELD  CONSTR  METHOD 