Package com.jme3.terrain.heightmap
Class FaultHeightMap
java.lang.Object
com.jme3.terrain.heightmap.AbstractHeightMap
com.jme3.terrain.heightmap.FaultHeightMap
- All Implemented Interfaces:
- HeightMap
Creates a heightmap based on the fault algorithm. Each iteration, a random line
 crossing the map is generated. On one side height values are raised, on the other side
 lowered.
- 
Field SummaryFieldsModifier and TypeFieldDescriptionstatic final intA circular fault is created.static final intA linear fault is createdstatic final intValues are lowered on one side, increased on the other, creating a cosine curve on the fault linestatic final intValues on one side are lowered, then increase linearly while crossing the fault line to the other side.static final intValue are lowered on both side, but increased on the fault line creating a smooth ridge on the fault line.static final intValues on one side are lowered, on the other side increased, creating a step at the fault lineFields inherited from class com.jme3.terrain.heightmap.AbstractHeightMapfilter, heightData, heightScale, NORMALIZE_RANGE, size
- 
Constructor SummaryConstructorsConstructorDescriptionFaultHeightMap(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.
- 
Method SummaryModifier and TypeMethodDescriptionprotected voidaddCircleFault(float[][] tempBuffer, Random random, float faultHeight, float range) protected voidprotected voidaddLineFault(float[][] tempBuffer, Random random, float faultHeight, float range) protected floatcalcHeight(float dist, Random random, float faultHeight, float range) intintintfloatfloatfloatfloatfloatfloatlonggetSeed()booleanload()loadpopulates the height map data.voidsetFaultShape(int faultShape) voidsetFaultType(int faultType) voidsetIterations(int iterations) voidsetMaxFaultHeight(float maxFaultHeight) voidsetMaxRadius(float maxRadius) voidsetMaxRange(float maxRange) voidsetMinFaultHeight(float minFaultHeight) voidsetMinRadius(float minRadius) voidsetMinRange(float minRange) voidsetSeed(long seed) Methods inherited from class com.jme3.terrain.heightmap.AbstractHeightMaperodeTerrain, findMinMaxHeights, flatten, getHeightMap, getInterpolatedHeight, getScaledHeightAtPoint, getScaledHeightMap, getSize, getTrueHeightAtPoint, normalizeTerrain, save, setHeightAtPoint, setHeightScale, setMagnificationFilter, setSize, smooth, smooth, unloadHeightMap
- 
Field Details- 
FAULTTYPE_STEPpublic static final int FAULTTYPE_STEPValues on one side are lowered, on the other side increased, creating a step at the fault line- See Also:
 
- 
FAULTTYPE_LINEARpublic static final int FAULTTYPE_LINEARValues on one side are lowered, then increase linearly while crossing the fault line to the other side. The fault line will be an inclined plane- See Also:
 
- 
FAULTTYPE_COSINEpublic static final int FAULTTYPE_COSINEValues are lowered on one side, increased on the other, creating a cosine curve on the fault line- See Also:
 
- 
FAULTTYPE_SINEpublic static final int FAULTTYPE_SINEValue are lowered on both side, but increased on the fault line creating a smooth ridge on the fault line.- See Also:
 
- 
FAULTSHAPE_LINEpublic static final int FAULTSHAPE_LINEA linear fault is created- See Also:
 
- 
FAULTSHAPE_CIRCLEpublic static final int FAULTSHAPE_CIRCLEA circular fault is created.- See Also:
 
 
- 
- 
Constructor Details- 
FaultHeightMappublic FaultHeightMap(int size, int iterations, int faultType, int faultShape, float minFaultHeight, float maxFaultHeight, long seed) throws Exception Constructor creates the fault. For faultType other than STEP, a range can be provided. For faultShape circle, min and max radii can be provided. Don't forget to reload the map if you have set parameters after the constructor call.- Parameters:
- size- The size of the heightmap
- iterations- Iterations to perform
- faultType- Type of fault
- faultShape- Shape of the fault -line or circle
- minFaultHeight- Height modified on each side
- maxFaultHeight- Height modified on each side
- seed- A seed to feed the Random generator
- Throws:
- Exception
- See Also:
 
- 
FaultHeightMappublic FaultHeightMap(int size, int iterations, float minFaultHeight, float maxFaultHeight) throws Exception Create a heightmap with linear step faults.- Parameters:
- size- size of heightmap
- iterations- number of iterations
- minFaultHeight- Height modified on each side
- maxFaultHeight- Height modified on each side
- Throws:
- Exception
 
 
- 
- 
Method Details- 
loadpublic boolean load()Description copied from interface:HeightMaploadpopulates the height map data. This is dependent on the subclass's implementation.- Returns:
- true if the load was successful, false otherwise.
 
- 
addFault
- 
addLineFault
- 
addCircleFault
- 
calcHeight
- 
getFaultShapepublic int getFaultShape()
- 
setFaultShapepublic void setFaultShape(int faultShape) 
- 
getFaultTypepublic int getFaultType()
- 
setFaultTypepublic void setFaultType(int faultType) 
- 
getIterationspublic int getIterations()
- 
setIterationspublic void setIterations(int iterations) 
- 
getMaxFaultHeightpublic float getMaxFaultHeight()
- 
setMaxFaultHeightpublic void setMaxFaultHeight(float maxFaultHeight) 
- 
getMaxRadiuspublic float getMaxRadius()
- 
setMaxRadiuspublic void setMaxRadius(float maxRadius) 
- 
getMaxRangepublic float getMaxRange()
- 
setMaxRangepublic void setMaxRange(float maxRange) 
- 
getMinFaultHeightpublic float getMinFaultHeight()
- 
setMinFaultHeightpublic void setMinFaultHeight(float minFaultHeight) 
- 
getMinRadiuspublic float getMinRadius()
- 
setMinRadiuspublic void setMinRadius(float minRadius) 
- 
getMinRangepublic float getMinRange()
- 
setMinRangepublic void setMinRange(float minRange) 
- 
getSeedpublic long getSeed()
- 
setSeedpublic void setSeed(long seed) 
 
-