public abstract class ROAMPatch extends Object
A patch represents a single block of geometry within the overall scheme of the terrain data. Apart from a fixed size nothing else is fixed in this patch. The patch consists of a single TriangleArray that uses a geometry updater (geometry by reference is used) to update the geometry each frame as necessary. It will, when instructed, dynamically recalculate what vertices need to be shown and set those into the geometry array.
This is an abstract representation that renderer-specific items should be extending with their own geometry handling.
| Modifier and Type | Field and Description |
|---|---|
protected float |
maxY
The maximum Y for this patch
|
protected float |
minY
The minimumY for this patch
|
protected TreeNode |
NWTree
The values of the nodes in the NW triangle of this patch
|
protected int |
PATCH_SIZE
The final size in number of grid points for this patch
|
protected boolean |
resetRequested
Flag to indicate if a clear has been requested
|
protected TreeNode |
SETree
The values of the nodes in the NW triangle of this patch
|
protected TerrainData |
terrainData
Source terrain data
|
protected Point |
tileOrigin
The origin of the patch in tile coordinates
|
protected VertexData |
vertexData
Raw vertex collection information
|
protected org.j3d.util.frustum.ViewFrustum |
viewFrustum
The view frustum used for this terrain
|
| Modifier | Constructor and Description |
|---|---|
protected |
ROAMPatch(TerrainData terrain,
int patchSize,
org.j3d.util.frustum.ViewFrustum frustum,
int patchX,
int patchY)
Create a new patch based on the terrain and appearance information.
|
| Modifier and Type | Method and Description |
|---|---|
void |
clear()
Instruct this patch that it is about to be removed from active duty.
|
protected void |
createGeometry()
Create the geometry needed for this patch.
|
protected void |
setOrigin(int xOrig,
int yOrig)
Setup this patch with new data from the terrain.
|
String |
toString2()
Create a string representation of this patch.
|
abstract void |
updateGeometry()
Request an update to the geometry.
|
protected final int PATCH_SIZE
protected TreeNode NWTree
protected TreeNode SETree
protected Point tileOrigin
protected TerrainData terrainData
protected org.j3d.util.frustum.ViewFrustum viewFrustum
protected VertexData vertexData
protected float maxY
protected float minY
protected boolean resetRequested
protected ROAMPatch(TerrainData terrain, int patchSize, org.j3d.util.frustum.ViewFrustum frustum, int patchX, int patchY)
terrain - The raw height map info to use for this terrainpatchSize - The number of grid points to use in the patch on a sidefrustum - The view frustum container usedpublic abstract void updateGeometry()
public void clear()
protected void setOrigin(int xOrig,
int yOrig)
xOrig - The tileOrigin of the X grid coord for this patch in the
global set of grid coordinatesyOrig - The tileOrigin of the Y grid coord for this patch in the
global set of grid coordinatesprotected void createGeometry()
public String toString2()
Copyright © 2001 - 2015 j3d.org