public class HeightMapFactory
extends java.lang.Object
Constructor and Description |
---|
HeightMapFactory() |
Modifier and Type | Method and Description |
---|---|
static double[][] |
heightMap(int width,
int height,
double offset)
Returns a randomly generated map of doubles that smoothly change nearby.
|
static float[][] |
heightMapSeeded(int width,
int height,
int seed)
Returns a randomly generated map of floats.
|
public static double[][] heightMap(int width, int height, double offset)
FastNoise
to generate coherent heights. The offset
parameter is
converted to an int seed via NumberTools.doubleToMixedIntBits(double)
, so it can be any
double, even an infinite one, and will still be treated as a valid seed.width
- in cellsheight
- in cellsoffset
- a double that changes the sampling process; the range doesn't matterpublic static float[][] heightMapSeeded(int width, int height, int seed)
FastNoise
(producing FBM Simplex noise) to generate coherent heights.
Unlike heightMap(int, int, double)
, this doesn't drop off heights at the east and west edges of the map.
As such, it may be more suitable for local maps than world maps, since it is unlikely to tile east-west.width
- in cellsheight
- in cellsseed
- an int that significantly changes the generation processCopyright © Eben Howard 2012–2022. All rights reserved.