Package rosequartz.rng
Class NoiseGenerator
java.lang.Object
rosequartz.rng.NoiseGenerator
-
Constructor Summary
ConstructorsConstructorDescriptionCreates a noise generator with a random seed.NoiseGenerator(long seed)Creates a noise generator from a seed to use. -
Method Summary
Modifier and TypeMethodDescriptionfloatgetOpenSimplex(float x, float y, float z)Returns the value of an open simplex noise map at the given coordinates for the current seed.floatgetPerlin(float x, float y, float z)Returns the value of a perlin noise map at the given coordinates for the current seed.longgetSeed()Gets the current seed used to generate from.setSeed(long seed)Sets the seed to generate from.
-
Constructor Details
-
NoiseGenerator
public NoiseGenerator()Creates a noise generator with a random seed. -
NoiseGenerator
public NoiseGenerator(long seed)Creates a noise generator from a seed to use.- Parameters:
seed- the seed to generate from
-
-
Method Details
-
setSeed
Sets the seed to generate from.- Parameters:
seed- seed to use- Returns:
- this
-
getSeed
public long getSeed()Gets the current seed used to generate from.- Returns:
- current seed
-
getPerlin
public float getPerlin(float x, float y, float z)Returns the value of a perlin noise map at the given coordinates for the current seed.- Parameters:
x- x-coordinate on the noise mapy- y-coordinate on the noise mapz- z-coordinate on the noise map- Returns:
- the value
-
getOpenSimplex
public float getOpenSimplex(float x, float y, float z)Returns the value of an open simplex noise map at the given coordinates for the current seed.- Parameters:
x- x-coordinate on the noise mapy- y-coordinate on the noise mapz- z-coordinate on the noise map- Returns:
- the value
-