/** * Constructor sets the attributes of the hill system and generates the * height map. * * @param size * size the size of the terrain to be generated * @param iterations * the number of iterations to do * @throws JmeException * if size of the terrain is not greater that zero, or number of * iterations is not greater that zero */ public FluidSimHeightMap(int size, int iterations) throws Exception { if (size <= 0 || iterations <= 0) { throw new Exception( "Either size of the terrain is not greater that zero, " + "or number of iterations is not greater that zero"); } this.size = size; this.iterations = iterations; load(); }
public boolean load() { unloadHeightMap(); tempBuffer[0][j + i * size] = tempBuffer[1][j + i * size] = randomRange(random, minInitialHeight, maxInitialHeight); normalizeTerrain(NORMALIZE_RANGE);
public boolean load() { unloadHeightMap(); tempBuffer[0][j + i * size] = tempBuffer[1][j + i * size] = randomRange(random, minInitialHeight, maxInitialHeight); normalizeTerrain(NORMALIZE_RANGE);
this.nodeDistance = nodeDistance; load();
/** * Constructor sets the attributes of the hill system and generates the * height map. * * @param size * size the size of the terrain to be generated * @param iterations * the number of iterations to do * @throws JmeException * if size of the terrain is not greater that zero, or number of * iterations is not greater that zero */ public FluidSimHeightMap(int size, int iterations) throws Exception { if (size <= 0 || iterations <= 0) { throw new Exception( "Either size of the terrain is not greater that zero, " + "or number of iterations is not greater that zero"); } this.size = size; this.iterations = iterations; load(); }
this.nodeDistance = nodeDistance; load();