|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface Terrain
Terrain can be one or many meshes comprising of a, probably large, piece of land. Terrain is Y-up in the grid axis, meaning gravity acts in the -Y direction. Level of Detail (LOD) is supported and expected as terrains can get very large. LOD can also be disabled if you so desire, however some terrain implementations can choose to ignore useLOD(boolean). Terrain implementations should extend Node, or at least Spatial.
Method Summary | |
---|---|
void |
adjustHeight(java.util.List<Vector2f> xz,
java.util.List<java.lang.Float> height)
Raise/lower the height at many points. |
void |
adjustHeight(Vector2f xzCoordinate,
float delta)
Raise/lower the height in one call (instead of getHeight then setHeight). |
void |
generateEntropy(ProgressMonitor monitor)
Pre-calculate entropy values. |
float |
getHeight(Vector2f xz)
Get the real-world height of the terrain at the specified X-Z coorindate. |
float[] |
getHeightMap()
Get the heightmap of the entire terrain. |
float |
getHeightmapHeight(Vector2f xz)
Get the heightmap height at the specified X-Z coordinate. |
Material |
getMaterial()
Returns the material that this terrain uses. |
Material |
getMaterial(Vector3f worldLocation)
Returns the material that this terrain uses. |
int |
getMaxLod()
This is calculated by the specific LOD algorithm. |
Vector3f |
getNormal(Vector2f xz)
Get the normal vector for the surface of the terrain at the specified X-Z coordinate. |
int |
getNumMajorSubdivisions()
|
int |
getTerrainSize()
Used for painting to get the number of vertices along the edge of the terrain. |
void |
setHeight(java.util.List<Vector2f> xz,
java.util.List<java.lang.Float> height)
Set the height at many points. |
void |
setHeight(Vector2f xzCoordinate,
float height)
Set the height at the specified X-Z coordinate. |
void |
setLocked(boolean locked)
Lock or unlock the meshes of this terrain. |
Method Detail |
---|
float getHeight(Vector2f xz)
xz
- the X-Z world coordinate
Vector3f getNormal(Vector2f xz)
xz
- the X-Z world coordinate
float getHeightmapHeight(Vector2f xz)
xz
- world coordinate
void setHeight(Vector2f xzCoordinate, float height)
xzCoordinate
- coordinate to set the heightheight
- that will be set at the coordinatevoid setHeight(java.util.List<Vector2f> xz, java.util.List<java.lang.Float> height)
xz
- a list of coordinates where the hight will be setheight
- the heights that match the xz coordinatesvoid adjustHeight(Vector2f xzCoordinate, float delta)
xzCoordinate
- world coordinate to adjust the terrain heightdelta
- +- value to adjust the height byvoid adjustHeight(java.util.List<Vector2f> xz, java.util.List<java.lang.Float> height)
xz
- a list of coordinates where the hight will be adjustedheight
- +- value to adjust the height by, that matches the xz coordinatesfloat[] getHeightMap()
int getMaxLod()
void setLocked(boolean locked)
locked
- or unlockedvoid generateEntropy(ProgressMonitor monitor)
Material getMaterial()
Material getMaterial(Vector3f worldLocation)
worldLocation
- the location, in world coordinates, of where
we are interested in the underlying texture.int getTerrainSize()
int getNumMajorSubdivisions()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |