public class FaultHeightMap extends AbstractHeightMap
Modifier and Type | Field and Description |
---|---|
static int |
FAULTSHAPE_CIRCLE
A circular fault is created.
|
static int |
FAULTSHAPE_LINE
A linear fault is created
|
static int |
FAULTTYPE_COSINE
Values are lowered on one side, increased on the other, creating a
cosine curve on the fault line
|
static int |
FAULTTYPE_LINEAR
Values on one side are lowered, then increase lineary while crossing
the fault line to the other side.
|
static int |
FAULTTYPE_SINE
Value are lowered on both side, but increased on the fault line
creating a smooth ridge on the fault line.
|
static int |
FAULTTYPE_STEP
Values on one side are lowered, on the other side increased,
creating a step at the fault line
|
filter, heightData, heightScale, NORMALIZE_RANGE, size
Constructor and Description |
---|
FaultHeightMap(int size,
int iterations,
float minFaultHeight,
float maxFaultHeight)
Create a heightmap with linear step faults.
|
FaultHeightMap(int size,
int iterations,
int faultType,
int faultShape,
float minFaultHeight,
float maxFaultHeight,
long seed)
Constructor creates the fault.
|
Modifier and Type | Method and Description |
---|---|
protected void |
addCircleFault(float[][] tempBuffer,
java.util.Random random,
float faultHeight,
float range) |
protected void |
addFault(float[][] tempBuffer,
java.util.Random random) |
protected void |
addLineFault(float[][] tempBuffer,
java.util.Random random,
float faultHeight,
float range) |
protected float |
calcHeight(float dist,
java.util.Random random,
float faultHeight,
float range) |
int |
getFaultShape() |
int |
getFaultType() |
int |
getIterations() |
float |
getMaxFaultHeight() |
float |
getMaxRadius() |
float |
getMaxRange() |
float |
getMinFaultHeight() |
float |
getMinRadius() |
float |
getMinRange() |
long |
getSeed() |
boolean |
load()
load populates the height map data. |
void |
setFaultShape(int faultShape) |
void |
setFaultType(int faultType) |
void |
setIterations(int iterations) |
void |
setMaxFaultHeight(float maxFaultHeight) |
void |
setMaxRadius(float maxRadius) |
void |
setMaxRange(float maxRange) |
void |
setMinFaultHeight(float minFaultHeight) |
void |
setMinRadius(float minRadius) |
void |
setMinRange(float minRange) |
void |
setSeed(long seed) |
erodeTerrain, findMinMaxHeights, flatten, getHeightMap, getInterpolatedHeight, getScaledHeightAtPoint, getScaledHeightMap, getSize, getTrueHeightAtPoint, normalizeTerrain, save, setHeightAtPoint, setHeightScale, setMagnificationFilter, setSize, smooth, smooth, unloadHeightMap
public static final int FAULTTYPE_STEP
public static final int FAULTTYPE_LINEAR
public static final int FAULTTYPE_COSINE
public static final int FAULTTYPE_SINE
public static final int FAULTSHAPE_LINE
public static final int FAULTSHAPE_CIRCLE
public FaultHeightMap(int size, int iterations, int faultType, int faultShape, float minFaultHeight, float maxFaultHeight, long seed) throws java.lang.Exception
size
- The size of the heightmapiterations
- Iterations to performfaultType
- Type of faultfaultShape
- Shape of the fault -line or circleminFaultHeight
- Height modified on each sidemaxFaultHeight
- Height modified on each sideseed
- A seed to feed the Random generatorjava.lang.Exception
setMinRadius(float)
,
setMaxRadius(float)
public FaultHeightMap(int size, int iterations, float minFaultHeight, float maxFaultHeight) throws java.lang.Exception
size
- size of heightmapiterations
- number of iterationsminFaultHeight
- Height modified on each sidemaxFaultHeight
- Height modified on each sidejava.lang.Exception
public boolean load()
HeightMap
load
populates the height map data. This is dependent on
the subclass's implementation.protected void addFault(float[][] tempBuffer, java.util.Random random)
protected void addLineFault(float[][] tempBuffer, java.util.Random random, float faultHeight, float range)
protected void addCircleFault(float[][] tempBuffer, java.util.Random random, float faultHeight, float range)
protected float calcHeight(float dist, java.util.Random random, float faultHeight, float range)
public int getFaultShape()
public void setFaultShape(int faultShape)
public int getFaultType()
public void setFaultType(int faultType)
public int getIterations()
public void setIterations(int iterations)
public float getMaxFaultHeight()
public void setMaxFaultHeight(float maxFaultHeight)
public float getMaxRadius()
public void setMaxRadius(float maxRadius)
public float getMaxRange()
public void setMaxRange(float maxRange)
public float getMinFaultHeight()
public void setMinFaultHeight(float minFaultHeight)
public float getMinRadius()
public void setMinRadius(float minRadius)
public float getMinRange()
public void setMinRange(float minRange)
public long getSeed()
public void setSeed(long seed)