|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjme.locale.external.data.AbstractHeightMap
jme.locale.external.data.MidPointHeightMap
MidPointHeightMap
Field Summary |
Fields inherited from class jme.locale.external.data.AbstractHeightMap |
filter, heightData, heightScale, size |
Constructor Summary | |
MidPointHeightMap(int size,
float roughness)
Constructor builds a new heightmap using the midpoint displacement algorithm. |
Method Summary | |
boolean |
load()
load generates the heightfield using the Midpoint Displacement
algorithm. |
void |
setRoughness(float roughness)
setRoughness sets the new roughness value of the
heightmap. |
Methods inherited from class jme.locale.external.data.AbstractHeightMap |
erodeTerrain, getHeightMap, getInterpolatedHeight, getScaledHeightAtPoint, getSize, getTrueHeightAtPoint, normalizeTerrain, save, setFilter, setHeightAtPoint, setHeightScale, setSize, unloadHeightMap |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public MidPointHeightMap(int size, float roughness)
size
- the size of the terrain, must be a power of 2.roughness
- how chaotic to make the terrain.
MonkeyRuntimeException
- if size is less than or equal to
zero or roughtness is less than 0.Method Detail |
public boolean load()
load
generates the heightfield using the Midpoint Displacement
algorithm. load
uses the latest attributes, so a call
to load
is recommended if attributes have changed using
the set methods.
load
in class AbstractHeightMap
public void setRoughness(float roughness)
setRoughness
sets the new roughness value of the
heightmap. Roughness determines how chaotic the terrain will be.
Where 1 is perfectly self-similar, > 1 early iterations have a
disproportionately large effect creating smooth terrain, and < 1
late iteraions have a disproportionately large effect creating
chaotic terrain.
roughness
- how chaotic will the heightmap be.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |