Package squidpony.squidmath
Class MasonNoise
java.lang.Object
squidpony.squidmath.MasonNoise
- All Implemented Interfaces:
Noise.Noise2D
,Noise.Noise3D
,Noise.Noise4D
,Noise.Noise6D
public class MasonNoise extends Object implements Noise.Noise2D, Noise.Noise3D, Noise.Noise4D, Noise.Noise6D
Noise functions that delegate work to the best-suited noise type for the requested dimensionality, plus some extra
functions that affect a large multi-dimensional area at once. This will use
The name comes from the Freemasons, who as a secret society, are very good at behind-the-scenes work. MasonNoise also sounds a lot like MerlinNoise, which sounds a lot like PerlinNoise and WhirlingNoise.
FastNoise
for 2D and 3D noise,
WhirlingNoise
for 4D noise, and SeededNoise
for 6D noise. It uses its own, possibly sub-par
implementation for addNoiseField(float[][], float, float, float, float, long, float, float)
and
addNoiseField(float[][][], float, float, float, float, float, float, long, float, float)
.
The name comes from the Freemasons, who as a secret society, are very good at behind-the-scenes work. MasonNoise also sounds a lot like MerlinNoise, which sounds a lot like PerlinNoise and WhirlingNoise.
-
Field Summary
Fields Modifier and Type Field Description protected long
defaultSeed
static MasonNoise
instance
-
Constructor Summary
Constructors Constructor Description MasonNoise()
MasonNoise(long seed)
-
Method Summary
Modifier and Type Method Description static void
addNoiseField(float[][][] target, float startX, float startY, float startZ, float endX, float endY, float endZ, long seed, float multiplier, float shrink)
static void
addNoiseField(float[][] target, float startX, float startY, float endX, float endY, long seed, float multiplier, float shrink)
double
getNoise(double x, double y)
double
getNoise(double x, double y, double z)
double
getNoise(double x, double y, double z, double w)
double
getNoise(double x, double y, double z, double w, double u, double v)
double
getNoiseWithSeed(double x, double y, double z, double w, double u, double v, long seed)
double
getNoiseWithSeed(double x, double y, double z, double w, long seed)
double
getNoiseWithSeed(double x, double y, double z, long seed)
double
getNoiseWithSeed(double x, double y, long seed)
static double
noise(double x, double y, double z, double w, double u, double v, long seed)
static double
noise(double x, double y, double z, double w, long seed)
static double
noise(double x, double y, double z, long seed)
Delegates toFastNoise.getNoiseWithSeed(double, double, double, long)
.static double
noise(double x, double y, long seed)
Delegates toFastNoise.getNoiseWithSeed(double, double, long)
.static int
randomInt(long state)
static int
randomInt(long state, long jump)
static float
randomize(long state, long jump)
-
Field Details
-
Constructor Details
-
MasonNoise
public MasonNoise() -
MasonNoise
-
-
Method Details
-
getNoise
- Specified by:
getNoise
in interfaceNoise.Noise2D
-
getNoise
- Specified by:
getNoise
in interfaceNoise.Noise3D
-
getNoise
- Specified by:
getNoise
in interfaceNoise.Noise4D
-
getNoise
- Specified by:
getNoise
in interfaceNoise.Noise6D
-
getNoiseWithSeed
- Specified by:
getNoiseWithSeed
in interfaceNoise.Noise2D
-
getNoiseWithSeed
- Specified by:
getNoiseWithSeed
in interfaceNoise.Noise3D
-
getNoiseWithSeed
- Specified by:
getNoiseWithSeed
in interfaceNoise.Noise4D
-
getNoiseWithSeed
public double getNoiseWithSeed(double x, double y, double z, double w, double u, double v, long seed)- Specified by:
getNoiseWithSeed
in interfaceNoise.Noise6D
-
noise
Delegates toFastNoise.getNoiseWithSeed(double, double, long)
.- Parameters:
x
- X inputy
- Y inputseed
- any long; will be used to completely alter the noise- Returns:
- noise from -1.0 to 1.0, inclusive
-
randomize
-
randomInt
-
randomInt
-
addNoiseField
public static void addNoiseField(float[][] target, float startX, float startY, float endX, float endY, long seed, float multiplier, float shrink) -
addNoiseField
public static void addNoiseField(float[][][] target, float startX, float startY, float startZ, float endX, float endY, float endZ, long seed, float multiplier, float shrink) -
noise
Delegates toFastNoise.getNoiseWithSeed(double, double, double, long)
.- Parameters:
x
- X inputy
- Y inputz
- Z inputseed
- any long; will be used to completely alter the noise- Returns:
- noise from -1.0 to 1.0, inclusive
-
noise
- Parameters:
x
- X inputy
- Y inputz
- Z inputw
- W input (fourth-dimensional)seed
- any long; will be used to completely alter the noise- Returns:
- noise from -1.0 to 1.0, inclusive
-
noise
- Parameters:
x
- X inputy
- Y inputz
- Z inputw
- W input (fourth-dimensional)u
- U input (fifth-dimensional)v
- V input (sixth-dimensional)seed
- any long; will be used to completely alter the noise- Returns:
- noise from -1.0 to 1.0, inclusive
-