Package com.jme3.terrain.heightmap
Class FluidSimHeightMap
java.lang.Object
com.jme3.terrain.heightmap.AbstractHeightMap
com.jme3.terrain.heightmap.FluidSimHeightMap
- All Implemented Interfaces:
- HeightMap
FluidSimHeightMap generates a height map based using some
 sort of fluid simulation. The heightmap is treated as a highly viscous and
 rubbery fluid enabling to fine tune the generated heightmap using a number
 of parameters.- See Also:
- 
Field SummaryFields inherited from class com.jme3.terrain.heightmap.AbstractHeightMapfilter, heightData, heightScale, NORMALIZE_RANGE, size
- 
Constructor SummaryConstructorsConstructorDescriptionFluidSimHeightMap(int size, int iterations) Constructor sets the attributes of the hill system and generates the height map.FluidSimHeightMap(int size, int iterations, float minInitialHeight, float maxInitialHeight, float viscosity, float waveSpeed, float timestep, float nodeDistance, long seed) Constructor sets the attributes of the hill system and generates the height map.
- 
Method SummaryModifier and TypeMethodDescriptionbooleanload()Generates a heightmap using fluid simulation and the attributes set by the constructor or the setters.voidsetIterations(int iterations) Sets the number of times the fluid simulation should be iterated over the heightmap.voidsetMaxInitialHeight(float maxInitialHeight) Sets the maximum initial height of the terrain.voidsetMinInitialHeight(float minInitialHeight) Sets the minimum initial height of the terrain.voidsetNodeDistance(float nodeDistance) Sets the distance between each node of the heightmap.voidsetTimeStep(float timeStep) Sets the time-speed between each iteration of the fluid simulation algorithm.voidsetViscosity(float viscosity) Sets the viscosity of the simulated fluid.voidsetWaveSpeed(float waveSpeed) Sets the speed at which the waves travel.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
- 
Constructor Details- 
FluidSimHeightMappublic FluidSimHeightMap(int size, int iterations, float minInitialHeight, float maxInitialHeight, float viscosity, float waveSpeed, float timestep, float nodeDistance, long seed) throws Exception Constructor sets the attributes of the hill system and generates the height map. It gets passed a number of tweakable parameters which fine-tune the outcome.- Parameters:
- size- size the size of the terrain to be generated
- iterations- the number of iterations to do
- minInitialHeight- the minimum initial height of a terrain value
- maxInitialHeight- the maximum initial height of a terrain value
- viscosity- the viscosity of the fluid
- waveSpeed- the speed at which the waves travel
- timestep- the constant time-step between each iteration
- nodeDistance- the distance between each node of the heightmap
- seed- the seed to generate the same heightmap again
- Throws:
- Exception- if size of the terrain is not greater than zero, or number of iterations is not greater that zero, or the minimum initial height is greater than the maximum (or the other way around)
 
- 
FluidSimHeightMapConstructor sets the attributes of the hill system and generates the height map.- Parameters:
- size- size the size of the terrain to be generated
- iterations- the number of iterations to do
- Throws:
- Exception- if size of the terrain is not greater than zero, or number of iterations is not greater than zero
 
 
- 
- 
Method Details- 
loadpublic boolean load()Generates a heightmap using fluid simulation and the attributes set by the constructor or the setters.- Returns:
- true if the load was successful, false otherwise.
 
- 
setIterationsSets the number of times the fluid simulation should be iterated over the heightmap. The more iterations, the fewer features (hills, etcetera) the terrain will have, and the smoother it will be.- Parameters:
- iterations- the number of iterations to perform
- Throws:
- Exception- if iterations is not greater than zero
 
- 
setMaxInitialHeightpublic void setMaxInitialHeight(float maxInitialHeight) Sets the maximum initial height of the terrain.- Parameters:
- maxInitialHeight- the maximum initial height
- See Also:
 
- 
setMinInitialHeightpublic void setMinInitialHeight(float minInitialHeight) Sets the minimum initial height of the terrain.- Parameters:
- minInitialHeight- the minimum initial height
- See Also:
 
- 
setNodeDistancepublic void setNodeDistance(float nodeDistance) Sets the distance between each node of the heightmap.- Parameters:
- nodeDistance- the distance between each node
 
- 
setTimeSteppublic void setTimeStep(float timeStep) Sets the time-speed between each iteration of the fluid simulation algorithm.- Parameters:
- timeStep- the time-step between each iteration
 
- 
setViscositypublic void setViscosity(float viscosity) Sets the viscosity of the simulated fluid.- Parameters:
- viscosity- the viscosity of the fluid
 
- 
setWaveSpeedpublic void setWaveSpeed(float waveSpeed) Sets the speed at which the waves travel.- Parameters:
- waveSpeed- the speed at which the waves travel
 
 
-