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 longdefaultSeedstatic MasonNoiseinstance -
Constructor Summary
Constructors Constructor Description MasonNoise()MasonNoise(long seed) -
Method Summary
Modifier and Type Method Description static voidaddNoiseField(float[][][] target, float startX, float startY, float startZ, float endX, float endY, float endZ, long seed, float multiplier, float shrink)static voidaddNoiseField(float[][] target, float startX, float startY, float endX, float endY, long seed, float multiplier, float shrink)doublegetNoise(double x, double y)doublegetNoise(double x, double y, double z)doublegetNoise(double x, double y, double z, double w)doublegetNoise(double x, double y, double z, double w, double u, double v)doublegetNoiseWithSeed(double x, double y, double z, double w, double u, double v, long seed)doublegetNoiseWithSeed(double x, double y, double z, double w, long seed)doublegetNoiseWithSeed(double x, double y, double z, long seed)doublegetNoiseWithSeed(double x, double y, long seed)static doublenoise(double x, double y, double z, double w, double u, double v, long seed)static doublenoise(double x, double y, double z, double w, long seed)static doublenoise(double x, double y, double z, long seed)Delegates toFastNoise.getNoiseWithSeed(double, double, double, long).static doublenoise(double x, double y, long seed)Delegates toFastNoise.getNoiseWithSeed(double, double, long).static intrandomInt(long state)static intrandomInt(long state, long jump)static floatrandomize(long state, long jump)
-
Field Details
-
Constructor Details
-
MasonNoise
public MasonNoise() -
MasonNoise
-
-
Method Details
-
getNoise
- Specified by:
getNoisein interfaceNoise.Noise2D
-
getNoise
- Specified by:
getNoisein interfaceNoise.Noise3D
-
getNoise
- Specified by:
getNoisein interfaceNoise.Noise4D
-
getNoise
- Specified by:
getNoisein interfaceNoise.Noise6D
-
getNoiseWithSeed
- Specified by:
getNoiseWithSeedin interfaceNoise.Noise2D
-
getNoiseWithSeed
- Specified by:
getNoiseWithSeedin interfaceNoise.Noise3D
-
getNoiseWithSeed
- Specified by:
getNoiseWithSeedin interfaceNoise.Noise4D
-
getNoiseWithSeed
public double getNoiseWithSeed(double x, double y, double z, double w, double u, double v, long seed)- Specified by:
getNoiseWithSeedin 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
-