Package dev.prozilla.pine.common.random
Class NoiseGenerator
java.lang.Object
dev.prozilla.pine.common.random.NoiseGenerator
Utility class for random noise generation.
Source: Perlin Noise by Aleksey Ilyin
-
Constructor Summary
ConstructorsConstructorDescriptionCreates a noise generator with a random seed.NoiseGenerator(double seed) Creates a noise generator. -
Method Summary
Modifier and TypeMethodDescriptiondoublegetSeed()doublenoise(double x) Generates a noise value between-1and1.doublenoise(double x, double y) Generates a noise value between-1and1.doublenoise(double x, double y, double z) Generates a noise value between-1and1.doublenoise(double x, double y, double z, int size) Generates a noise value between-1and1.voidsetSeed(double seed) doublesmoothNoise(double x, double y, double z) Generates a noise value between-1and1.
-
Constructor Details
-
NoiseGenerator
public NoiseGenerator()Creates a noise generator with a random seed. -
NoiseGenerator
public NoiseGenerator(double seed) Creates a noise generator.- Parameters:
seed- Seed
-
-
Method Details
-
setSeed
public void setSeed(double seed) -
getSeed
public double getSeed() -
noise
public double noise(double x, double y, double z, int size) Generates a noise value between-1and1. -
noise
public double noise(double x, double y, double z) Generates a noise value between-1and1. -
noise
public double noise(double x, double y) Generates a noise value between-1and1. -
noise
public double noise(double x) Generates a noise value between-1and1. -
smoothNoise
public double smoothNoise(double x, double y, double z) Generates a noise value between-1and1.
-