com.jme3.terrain.heightmap
クラス MidpointDisplacementHeightMap
java.lang.Object
com.jme3.terrain.heightmap.AbstractHeightMap
com.jme3.terrain.heightmap.MidpointDisplacementHeightMap
- すべての実装されたインタフェース:
- HeightMap
public class MidpointDisplacementHeightMap
- extends AbstractHeightMap
MidpointDisplacementHeightMap
generates an heightmap based on
the midpoint displacement algorithm. See Constructor javadoc for more info.
クラス com.jme3.terrain.heightmap.AbstractHeightMap から継承されたメソッド |
erodeTerrain, findMinMaxHeights, flatten, getHeightMap, getInterpolatedHeight, getScaledHeightAtPoint, getScaledHeightMap, getSize, getTrueHeightAtPoint, normalizeTerrain, save, setHeightAtPoint, setHeightScale, setMagnificationFilter, setSize, smooth, unloadHeightMap |
クラス java.lang.Object から継承されたメソッド |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
MidpointDisplacementHeightMap
public MidpointDisplacementHeightMap(int size,
float range,
float persistence,
long seed)
throws java.lang.Exception
- The constructor generates the heightmap. After the first 4 corners are
randomly given an height, the center will be heighted to the average of
the 4 corners to which a random value is added. Then other passes fill
the heightmap by the same principle.
The random value is generated between the values
-range
and range
. The range
parameter is multiplied by
the persistence
parameter each pass to smoothen close cell heights.
Extends this class and override the getOffset function for more control of
the randomness (you can use the coordinates and/or the computed average height
to influence the random amount added.
- パラメータ:
size
- The size of the heightmap, must be 2^N+1range
- The range in which randomness will be added. A value of 1 will
allow -1 to 1 value changes.persistence
- The factor by which the range will evolve at each iteration.
A value of 0.5f will halve the range at each iteration and is
typically a good choiceseed
- A seed to feed the random number generator.
- 例外:
java.lang.Exception
MidpointDisplacementHeightMap
public MidpointDisplacementHeightMap(int size,
float range,
float persistence)
throws java.lang.Exception
- The constructor generates the heightmap. After the first 4 corners are
randomly given an height, the center will be heighted to the average of
the 4 corners to which a random value is added. Then other passes fill
the heightmap by the same principle.
The random value is generated between the values
-range
and range
. The range
parameter is multiplied by
the persistence
parameter each pass to smoothen close cell heights.
- パラメータ:
size
- The size of the heightmap, must be 2^N+1range
- The range in which randomness will be added. A value of 1 will
allow -1 to 1 value changes.persistence
- The factor by which the range will evolve at each iteration.
A value of 0.5f will halve the range at each iteration and is
typically a good choice
- 例外:
java.lang.Exception
load
public boolean load()
- Generate the heightmap.
- 戻り値:
getPersistence
public float getPersistence()
setPersistence
public void setPersistence(float persistence)
getRange
public float getRange()
setRange
public void setRange(float range)
getSeed
public long getSeed()
setSeed
public void setSeed(long seed)