|
j3d.org Code | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.j3d.terrain.roam.ROAMPatch
public abstract class ROAMPatch
A patch represents a single piece of terrain geometry that can be rendered as a standalone block within ROAM.
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.
Field Summary | |
---|---|
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 java.awt.Point |
tileOrigin
The origin of the patch in tile coordinates |
protected VertexData |
vertexData
Raw vertex collection information |
protected ViewFrustum |
viewFrustum
The view frustum used for this terrain |
Constructor Summary | |
---|---|
protected |
ROAMPatch(TerrainData terrain,
int patchSize,
ViewFrustum frustum,
int patchX,
int patchY)
Create a new patch based on the terrain and appearance information. |
Method Summary | |
---|---|
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. |
java.lang.String |
toString2()
Create a string representation of this patch. |
abstract void |
updateGeometry()
Request an update to the geometry. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected final int PATCH_SIZE
protected TreeNode NWTree
protected TreeNode SETree
protected java.awt.Point tileOrigin
protected TerrainData terrainData
protected ViewFrustum viewFrustum
protected VertexData vertexData
protected float maxY
protected float minY
protected boolean resetRequested
Constructor Detail |
---|
protected ROAMPatch(TerrainData terrain, int patchSize, 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 usedMethod Detail |
---|
public 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 java.lang.String toString2()
|
j3d.org Code | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |