public class FastNoise extends java.lang.Object implements java.io.Serializable, Noise.Noise2D, Noise.Noise3D, Noise.Noise4D, Noise.Noise5D, Noise.Noise6D
setNoiseType(int)
, controls what algorithm this uses to generate noise, and
affects most of the other options. Choose a "_FRACTAL" noise type like SIMPLEX_FRACTAL
(the default) if
you want to use any of the fractal options, like octaves, lacunarity, gain, or fractal type.setFrequency(float)
, affects how quickly significant changes in output can
occur over a given span of input values. It defaults to 1f/32f
, though you should try setting this to
1f
if results look strange.VALUE_FRACTAL
, PERLIN_FRACTAL
,
SIMPLEX_FRACTAL
, CUBIC_FRACTAL
, or FOAM_FRACTAL
):
setFractalType(int)
, which defaults to FBM
(almost the same as Noise.Layered2D
), and can also be set to
RIDGED_MULTI
(almost the same as Noise.Ridged2D
) or BILLOW
(related to RIDGED_MULTI in some ways). The noise type affects how the other fractal options work, and has a
very strong effect on the appearance of the noise when it changes.setFractalOctaves(int)
, are how many "layers" of noise this will calculate on
each call to get fractal noise. Each octave has its frequency changed based on lacunarity (set with
setFractalLacunarity(float)
), and contributes a different amount to the resulting value, based on
gain (set with setFractalGain(float)
). Generally, more octaves result in more detail and slower
generation times. SIMPLEX_FRACTAL
and PERLIN_FRACTAL
only really look like noise when they
use more than one octave.Noise.InverseLayered2D
by setting it to 0.5.1f / lacunarity
, or close to that.setPointHash(IPointHash)
, giving it a FlawedPointHash
or a point hash you made, and setting
noise type to CUBIC_FRACTAL
(or CUBIC
).CELLULAR
noise type has lots of extra configuration, and not all of it is well-documented, but
experimenting with settings like setCellularReturnType(int)
and
setCellularNoiseLookup(FastNoise)
is a good way to see if it can do what you want.Modifier and Type | Class and Description |
---|---|
static class |
FastNoise.Float2
Simple container class that holds 2 floats.
|
static class |
FastNoise.Float3
Simple container class that holds 3 floats.
|
Modifier and Type | Field and Description |
---|---|
static int |
BILLOW
A less common way to layer octaves of noise, where most results are biased toward higher values,
but "valleys" show up filled with much lower values.
|
static int |
CELL_VALUE
Meant to be used with
setCellularReturnType(int) . |
static int |
CELLULAR
Simple, very fast but very low-quality noise that forms a grid of squares, with their values blending at shared
edges somewhat.
|
protected int |
cellularDistanceFunction |
protected int |
cellularReturnType |
static int |
CUBIC
Simple, very fast but very low-quality noise that forms a grid of squares, with their values blending at shared
edges somewhat.
|
static int |
CUBIC_FRACTAL
Simple, very fast but very low-quality noise that forms a grid of squares, with their values blending at shared
edges somewhat.
|
static int |
DISTANCE
Meant to be used with
setCellularReturnType(int) . |
static int |
DISTANCE_2
Meant to be used with
setCellularReturnType(int) . |
static int |
DISTANCE_2_ADD
Meant to be used with
setCellularReturnType(int) . |
static int |
DISTANCE_2_DIV
Meant to be used with
setCellularReturnType(int) . |
static int |
DISTANCE_2_MUL
Meant to be used with
setCellularReturnType(int) . |
static int |
DISTANCE_2_SUB
Meant to be used with
setCellularReturnType(int) . |
static int |
EUCLIDEAN
Measures distances "as the crow flies."
All points at an equal distance from the origin form a circle.
|
static float |
F2f |
static float |
F3f |
static float |
F4f |
static int |
FBM
"Standard" layered octaves of noise, where each octave has a different frequency and weight.
|
static int |
FOAM
Simple, very fast but very low-quality noise that forms a grid of squares, with their values blending at shared
edges somewhat.
|
static int |
FOAM_FRACTAL
Simple, very fast but very low-quality noise that forms a grid of squares, with their values blending at shared
edges somewhat.
|
protected boolean |
fractalSpiral |
protected int |
fractalType |
protected float |
frequency |
static float |
G2f |
static float |
G3f |
static float |
G4f |
protected float |
gain |
protected static float[][] |
grad2f |
protected static float[] |
grad4f |
protected static squidpony.squidmath.FastNoise.Float5[] |
grad5f
This gradient vector array was quasi-randomly generated after a lot of rejection sampling.
|
protected static squidpony.squidmath.FastNoise.Float6[] |
grad6f |
protected float |
gradientPerturbAmp |
static float |
H2f |
static int |
HERMITE
Cubic interpolation via Hermite spline, more commonly known as "smoothstep".
|
static int |
HONEY
Simple, very fast but very low-quality noise that forms a grid of squares, with their values blending at shared
edges somewhat.
|
static int |
HONEY_FRACTAL
Simple, very fast but very low-quality noise that forms a grid of squares, with their values blending at shared
edges somewhat.
|
static FastNoise |
instance
A publicly available FastNoise object with seed 1337, frequency 1.0f/32.0f, 1 octave of Simplex noise using
SIMPLEX_FRACTAL noiseType, 2f lacunarity and 0.5f gain.
|
protected int |
interpolation |
protected float |
lacunarity |
static float |
LIMIT4 |
static int |
LINEAR
Simple linear interpolation.
|
static int |
MANHATTAN
Measures distances on a grid, as if allowing only orthogonal movement (with no diagonals).
|
static int |
MUTANT
Simple, very fast but very low-quality noise that forms a grid of squares, with their values blending at shared
edges somewhat.
|
static int |
MUTANT_FRACTAL
Simple, very fast but very low-quality noise that forms a grid of squares, with their values blending at shared
edges somewhat.
|
protected float |
mutation |
static int |
NATURAL
Measures distances with an approximation of Euclidean distance that's not 100% accurate.
|
static int |
NOISE_LOOKUP
Meant to be used with
setCellularReturnType(int) . |
protected int |
noiseType |
protected int |
octaves |
static int |
PERLIN
Simple, very fast but very low-quality noise that forms a grid of squares, with their values blending at shared
edges somewhat.
|
static int |
PERLIN_FRACTAL
Simple, very fast but very low-quality noise that forms a grid of squares, with their values blending at shared
edges somewhat.
|
protected IPointHash |
pointHash |
static int |
QUINTIC
Quintic interpolation, sometimes known as "smootherstep".
|
static int |
RIDGED_MULTI
A way to layer octaves of noise so most values are biased toward low values but "ridges" of high
values run across the noise.
|
protected int |
seed |
protected float |
sharpness |
static int |
SIMPLEX
Simple, very fast but very low-quality noise that forms a grid of squares, with their values blending at shared
edges somewhat.
|
static int |
SIMPLEX_FRACTAL
Simple, very fast but very low-quality noise that forms a grid of squares, with their values blending at shared
edges somewhat.
|
static int |
VALUE
Simple, very fast but very low-quality noise that forms a grid of squares, with their values blending at shared
edges somewhat.
|
static int |
VALUE_FRACTAL
Simple, very fast but very low-quality noise that forms a grid of squares, with their values blending at shared
edges somewhat.
|
static int |
WHITE_NOISE
Simple, very fast but very low-quality noise that forms a grid of squares, with their values blending at shared
edges somewhat.
|
Constructor and Description |
---|
FastNoise()
A constructor that takes no parameters, and uses all default settings with a seed of 1337.
|
FastNoise(FastNoise other)
Copy constructor; copies all non-temporary fields from
other into this. |
FastNoise(int seed)
A constructor that takes only a parameter for the FastNoise's seed, which should produce different results for
any different seeds.
|
FastNoise(int seed,
float frequency)
A constructor that takes two parameters to specify the FastNoise from the start.
|
FastNoise(int seed,
float frequency,
int noiseType)
A constructor that takes a few parameters to specify the FastNoise from the start.
|
FastNoise(int seed,
float frequency,
int noiseType,
int octaves)
A constructor that takes several parameters to specify the FastNoise from the start.
|
FastNoise(int seed,
float frequency,
int noiseType,
int octaves,
float lacunarity,
float gain)
A constructor that takes a lot of parameters to specify the FastNoise from the start.
|
Modifier and Type | Method and Description |
---|---|
protected static float |
cubicLerp(float a,
float b,
float c,
float d,
float t) |
protected static float |
dotf(float[] g,
float x,
float y) |
float |
getCellular(float x,
float y) |
float |
getCellular(float x,
float y,
float z) |
int |
getCellularDistanceFunction()
|
int |
getCellularReturnType()
Gets the return type from cellular noise calculations, corresponding to a constant from this class:
CELL_VALUE (0), NOISE_LOOKUP (1), DISTANCE (2), DISTANCE_2 (3),
DISTANCE_2_ADD (4), DISTANCE_2_SUB (5), DISTANCE_2_MUL (6), or
DISTANCE_2_DIV (7). |
float |
getConfiguredNoise(float x,
float y)
After being configured with the setters in this class, such as
setNoiseType(int) ,
setFrequency(float) , setFractalOctaves(int) , and setFractalType(int) , among others,
you can call this method to get the particular variety of noise you specified, in 2D. |
float |
getConfiguredNoise(float x,
float y,
float z)
After being configured with the setters in this class, such as
setNoiseType(int) ,
setFrequency(float) , setFractalOctaves(int) , and setFractalType(int) , among others,
you can call this method to get the particular variety of noise you specified, in 3D. |
float |
getConfiguredNoise(float x,
float y,
float z,
float w)
After being configured with the setters in this class, such as
setNoiseType(int) ,
setFrequency(float) , setFractalOctaves(int) , and setFractalType(int) , among others,
you can call this method to get the particular variety of noise you specified, in 4D. |
float |
getConfiguredNoise(float x,
float y,
float z,
float w,
float u)
After being configured with the setters in this class, such as
setNoiseType(int) ,
setFrequency(float) , setFractalOctaves(int) , and setFractalType(int) , among others,
you can call this method to get the particular variety of noise you specified, in 5D. |
float |
getConfiguredNoise(float x,
float y,
float z,
float w,
float u,
float v)
After being configured with the setters in this class, such as
setNoiseType(int) ,
setFrequency(float) , setFractalOctaves(int) , and setFractalType(int) , among others,
you can call this method to get the particular variety of noise you specified, in 6D. |
float |
getCubic(float x,
float y) |
float |
getCubic(float x,
float y,
float z) |
float |
getCubic(float x,
float y,
float z,
float w) |
float |
getCubicFractal(float x,
float y) |
float |
getCubicFractal(float x,
float y,
float z) |
float |
getCubicFractal(float x,
float y,
float z,
float w) |
float |
getFoam(float x,
float y) |
float |
getFoam(float x,
float y,
float z) |
float |
getFoam(float x,
float y,
float z,
float w) |
float |
getFoam(float x,
float y,
float z,
float w,
float u) |
float |
getFoam(float x,
float y,
float z,
float w,
float u,
float v) |
float |
getFoamFractal(float x,
float y) |
float |
getFoamFractal(float x,
float y,
float z) |
float |
getFoamFractal(float x,
float y,
float z,
float w,
float u) |
float |
getFoamFractal(float x,
float y,
float z,
float w,
float u,
float v) |
float |
getFoamSharpness()
Gets the "sharpness" for the
FOAM , FOAM_FRACTAL , MUTANT , MUTANT_FRACTAL ,
CUBIC , and CUBIC_FRACTAL noise types, which is usually
around 0.25f to 2.0f, and defaults to 1.0f. |
float |
getFractalGain()
Sets the octave gain for all fractal noise types.
|
float |
getFractalLacunarity()
Gets the octave lacunarity for all fractal noise types.
|
int |
getFractalOctaves()
Gets the octave count for all fractal noise types.
|
int |
getFractalType()
Gets the method for combining octaves in all fractal noise types, allowing an int argument corresponding to one
of the following constants from this class:
FBM (0), BILLOW (1), or RIDGED_MULTI (2). |
float |
getFrequency()
Gets the frequency for all noise types.
|
float |
getGradientPerturbAmp()
Gets the maximum perturb distance from original location when using
gradientPerturb2(float[]) ,
gradientPerturb3(float[]) , gradientPerturbFractal2(float[]) , or
gradientPerturbFractal3(float[]) ; the default is 1.0. |
float |
getHoney(float x,
float y) |
float |
getHoney(float x,
float y,
float z) |
float |
getHoney(float x,
float y,
float z,
float w) |
float |
getHoney(float x,
float y,
float z,
float w,
float u) |
float |
getHoney(float x,
float y,
float z,
float w,
float u,
float v) |
float |
getHoneyFractal(float x,
float y) |
float |
getHoneyFractal(float x,
float y,
float z) |
float |
getHoneyFractal(float x,
float y,
float z,
float w,
float u) |
float |
getHoneyFractal(float x,
float y,
float z,
float w,
float u,
float v) |
int |
getInterpolation()
Gets the constant corresponding to the interpolation method used to smooth between noise values.
|
float |
getMutation()
Gets the mutation value used by
MUTANT and MUTANT_FRACTAL noise types, which allows making
small changes to the result when the mutation values are slightly different. |
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 |
getNoise(double x,
double y,
double z,
double w,
double u,
double v) |
int |
getNoiseType()
Gets the default type of noise returned by
getConfiguredNoise(float, float) , using one of the following
constants in this class:
VALUE (0), VALUE_FRACTAL (1), PERLIN (2), PERLIN_FRACTAL (3),
SIMPLEX (4), SIMPLEX_FRACTAL (5), CELLULAR (6), WHITE_NOISE (7),
CUBIC (8), CUBIC_FRACTAL (9), FOAM (10), FOAM_FRACTAL (11), HONEY
(12), HONEY_FRACTAL (13), MUTANT (14), or MUTANT_FRACTAL (15). |
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,
double u,
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) |
float |
getNoiseWithSeed(float x,
float y,
float z,
float w,
float u,
float v,
int seed) |
float |
getNoiseWithSeed(float x,
float y,
float z,
float w,
float u,
int seed) |
float |
getNoiseWithSeed(float x,
float y,
float z,
float w,
int seed) |
float |
getNoiseWithSeed(float x,
float y,
float z,
int seed) |
float |
getNoiseWithSeed(float x,
float y,
int seed) |
float |
getPerlin(float x,
float y) |
float |
getPerlin(float x,
float y,
float z) |
float |
getPerlin(float x,
float y,
float z,
float w) |
float |
getPerlin(float x,
float y,
float z,
float w,
float u) |
float |
getPerlin(float x,
float y,
float z,
float w,
float u,
float v) |
float |
getPerlinFractal(float x,
float y) |
float |
getPerlinFractal(float x,
float y,
float z) |
IPointHash |
getPointHash()
Gets the point hash, an object implementing
IPointHash that is used to take 2 or more
coordinates and a seed and produce a usually-random-seeming hash value. |
int |
getSeed() |
float |
getSharpness()
Gets the "sharpness" for the
FOAM , FOAM_FRACTAL , MUTANT , MUTANT_FRACTAL ,
CUBIC , and CUBIC_FRACTAL noise types, which is usually
around 0.25f to 2.0f, and defaults to 1.0f. |
float |
getSimplex(float x,
float y) |
float |
getSimplex(float x,
float y,
float z) |
float |
getSimplex(float x,
float y,
float z,
float w) |
float |
getSimplex(float x,
float y,
float z,
float w,
float u) |
float |
getSimplex(float x,
float y,
float z,
float w,
float u,
float v) |
float |
getSimplexFractal(float x,
float y) |
float |
getSimplexFractal(float x,
float y,
float z) |
float |
getSimplexFractal(float x,
float y,
float z,
float w) |
float |
getSimplexFractal(float x,
float y,
float z,
float w,
float u) |
float |
getSimplexFractal(float x,
float y,
float z,
float w,
float u,
float v) |
float |
getValue(float x,
float y) |
float |
getValue(float x,
float y,
float z) |
float |
getValue(float x,
float y,
float z,
float w) |
float |
getValue(float x,
float y,
float z,
float w,
float u) |
float |
getValue(float x,
float y,
float z,
float w,
float u,
float v) |
float |
getValueFractal(float x,
float y) |
float |
getValueFractal(float x,
float y,
float z) |
float |
getValueFractal(float x,
float y,
float z,
float w) |
float |
getValueFractal(float x,
float y,
float z,
float w,
float u) |
float |
getValueFractal(float x,
float y,
float z,
float w,
float u,
float v) |
float |
getWhiteNoise(float x,
float y) |
float |
getWhiteNoise(float x,
float y,
float z) |
float |
getWhiteNoise(float x,
float y,
float z,
float w) |
float |
getWhiteNoise(float x,
float y,
float z,
float w,
float u) |
float |
getWhiteNoise(float x,
float y,
float z,
float w,
float u,
float v) |
protected float |
gradCoord2D(int seed,
int x,
int y,
float xd,
float yd) |
protected float |
gradCoord3D(int seed,
int x,
int y,
int z,
float xd,
float yd,
float zd) |
protected float |
gradCoord4D(int seed,
int x,
int y,
int z,
int w,
float xd,
float yd,
float zd,
float wd) |
protected float |
gradCoord5D(int seed,
int x,
int y,
int z,
int w,
int u,
float xd,
float yd,
float zd,
float wd,
float ud) |
protected float |
gradCoord6D(int seed,
int x,
int y,
int z,
int w,
int u,
int v,
float xd,
float yd,
float zd,
float wd,
float ud,
float vd) |
void |
gradientPerturb2(float[] v2) |
void |
gradientPerturb3(float[] v3) |
void |
gradientPerturbFractal2(float[] v2) |
void |
gradientPerturbFractal3(float[] v3) |
protected int |
hash256(int x,
int y,
int s) |
protected int |
hash256(int x,
int y,
int z,
int s) |
protected int |
hash256(int x,
int y,
int z,
int w,
int s) |
protected int |
hash256(int x,
int y,
int z,
int w,
int u,
int s) |
protected int |
hash256(int x,
int y,
int z,
int w,
int u,
int v,
int s) |
protected int |
hash32(int x,
int y,
int z,
int s) |
protected static float |
hermiteInterpolator(float t) |
boolean |
isFractalSpiral()
Returns true if this uses a spiraling rotation as octaves are added to fractal noise.
|
float |
layered2D(float x,
float y,
int seed,
int octaves)
Generates ridged-multi simplex noise with the given amount of octaves and default frequency (0.03125), lacunarity
(2) and gain (0.5) in 2D.
|
float |
layered2D(float x,
float y,
int seed,
int octaves,
float frequency)
Generates ridged-multi simplex noise with the given amount of octaves and default frequency (0.03125), lacunarity
(2) and gain (0.5) in 2D.
|
float |
layered2D(float x,
float y,
int seed,
int octaves,
float frequency,
float lacunarity)
Generates layered simplex noise with the given amount of octaves and specified lacunarity (the amount of
frequency change between octaves) and gain (0.5) in D.
|
float |
layered2D(float x,
float y,
int seed,
int octaves,
float frequency,
float lacunarity,
float gain)
Generates layered simplex noise with the given amount of octaves and specified lacunarity (the amount of
frequency change between octaves) and gain (loosely, how much to emphasize lower-frequency octaves) in 2D.
|
float |
layered3D(float x,
float y,
float z,
int seed,
int octaves)
Generates ridged-multi simplex noise with the given amount of octaves and default frequency (0.03125), lacunarity
(2) and gain (0.5) in 3D.
|
float |
layered3D(float x,
float y,
float z,
int seed,
int octaves,
float frequency)
Generates ridged-multi simplex noise with the given amount of octaves and default frequency (0.03125), lacunarity
(2) and gain (0.5) in 3D.
|
float |
layered3D(float x,
float y,
float z,
int seed,
int octaves,
float frequency,
float lacunarity)
Generates layered simplex noise with the given amount of octaves and specified lacunarity (the amount of
frequency change between octaves) and gain (0.5) in 3D.
|
float |
layered3D(float x,
float y,
float z,
int seed,
int octaves,
float frequency,
float lacunarity,
float gain)
Generates layered simplex noise with the given amount of octaves and specified lacunarity (the amount of
frequency change between octaves) and gain (loosely, how much to emphasize lower-frequency octaves) in 3D.
|
protected static float |
quinticInterpolator(float t) |
float |
ridged2D(float x,
float y,
int seed,
int octaves)
Generates ridged-multi simplex noise with the given amount of octaves and default frequency (0.03125), lacunarity
(2) and gain (0.5).
|
float |
ridged2D(float x,
float y,
int seed,
int octaves,
float frequency)
Generates ridged-multi simplex noise with the given amount of octaves and default frequency (0.03125), lacunarity
(2) and gain (0.5).
|
float |
ridged2D(float x,
float y,
int seed,
int octaves,
float frequency,
float lacunarity)
Generates ridged-multi simplex noise with the given amount of octaves and specified lacunarity (the amount of
frequency change between octaves); gain is not used.
|
float |
ridged3D(float x,
float y,
float z,
int seed,
int octaves)
Generates ridged-multi simplex noise with the given amount of octaves and default frequency (0.03125), lacunarity
(2) and gain (0.5).
|
float |
ridged3D(float x,
float y,
float z,
int seed,
int octaves,
float frequency)
Generates ridged-multi simplex noise with the given amount of octaves, specified frequency, and the default
lacunarity (2) and gain (0.5).
|
float |
ridged3D(float x,
float y,
float z,
int seed,
int octaves,
float frequency,
float lacunarity)
Generates ridged-multi simplex noise with the given amount of octaves and specified lacunarity (the amount of
frequency change between octaves); gain is not used.
|
protected float |
rotateM7D(float x,
float y,
float z,
float w,
float u,
float v,
float m) |
protected float |
rotateU5D(float x,
float y,
float z,
float w,
float u) |
protected float |
rotateU6D(float x,
float y,
float z,
float w,
float u,
float v) |
protected float |
rotateU7D(float x,
float y,
float z,
float w,
float u,
float v,
float m) |
protected float |
rotateV6D(float x,
float y,
float z,
float w,
float u,
float v) |
protected float |
rotateV7D(float x,
float y,
float z,
float w,
float u,
float v,
float m) |
protected float |
rotateW4D(float x,
float y,
float z,
float w) |
protected float |
rotateW5D(float x,
float y,
float z,
float w,
float u) |
protected float |
rotateW6D(float x,
float y,
float z,
float w,
float u,
float v) |
protected float |
rotateW7D(float x,
float y,
float z,
float w,
float u,
float v,
float m) |
protected float |
rotateX2D(float x,
float y) |
protected float |
rotateX3D(float x,
float y,
float z) |
protected float |
rotateX4D(float x,
float y,
float z,
float w) |
protected float |
rotateX5D(float x,
float y,
float z,
float w,
float u) |
protected float |
rotateX6D(float x,
float y,
float z,
float w,
float u,
float v) |
protected float |
rotateX7D(float x,
float y,
float z,
float w,
float u,
float v,
float m) |
protected float |
rotateY2D(float x,
float y) |
protected float |
rotateY3D(float x,
float y,
float z) |
protected float |
rotateY4D(float x,
float y,
float z,
float w) |
protected float |
rotateY5D(float x,
float y,
float z,
float w,
float u) |
protected float |
rotateY6D(float x,
float y,
float z,
float w,
float u,
float v) |
protected float |
rotateY7D(float x,
float y,
float z,
float w,
float u,
float v,
float m) |
protected float |
rotateZ3D(float x,
float y,
float z) |
protected float |
rotateZ4D(float x,
float y,
float z,
float w) |
protected float |
rotateZ5D(float x,
float y,
float z,
float w,
float u) |
protected float |
rotateZ6D(float x,
float y,
float z,
float w,
float u,
float v) |
protected float |
rotateZ7D(float x,
float y,
float z,
float w,
float u,
float v,
float m) |
void |
setCellularDistanceFunction(int cellularDistanceFunction)
|
void |
setCellularNoiseLookup(FastNoise noise)
Sets the FastNoise used to calculate a cell value if cellular return type is
NOISE_LOOKUP . |
void |
setCellularReturnType(int cellularReturnType)
Sets the return type from cellular noise calculations, allowing an int argument corresponding to one of the
following constants from this class:
CELL_VALUE (0), NOISE_LOOKUP (1), DISTANCE (2),
DISTANCE_2 (3), DISTANCE_2_ADD (4), DISTANCE_2_SUB (5), DISTANCE_2_MUL (6),
or DISTANCE_2_DIV (7). |
void |
setFoamSharpness(float foamSharpness)
Only used with
FOAM , FOAM_FRACTAL , MUTANT , MUTANT_FRACTAL , CUBIC ,
and CUBIC_FRACTAL noise types, this affects how often the noise will produce very high and very low
results (more often with high values of sharpness, such as 1.25 to 2.0),
as opposed to mid-range (more often with low values of sharpness, such as 0.25 to 0.75). |
void |
setFractalGain(float gain)
Sets the octave gain for all fractal noise types.
|
void |
setFractalLacunarity(float lacunarity)
Sets the octave lacunarity for all fractal noise types.
|
void |
setFractalOctaves(int octaves)
Sets the octave count for all fractal noise types.
|
void |
setFractalSpiral(boolean fractalSpiral)
Sets the fractal spiral mode on or off; if on, this uses a spiraling rotation as octaves are added to
fractal noise.
|
void |
setFractalType(int fractalType)
Sets the method for combining octaves in all fractal noise types, allowing an int argument corresponding to one
of the following constants from this class:
FBM (0), BILLOW (1), or RIDGED_MULTI (2). |
void |
setFrequency(float frequency)
Sets the frequency for all noise types.
|
void |
setGradientPerturbAmp(float gradientPerturbAmp)
Sets the maximum perturb distance from original location when using
gradientPerturb2(float[]) ,
gradientPerturb3(float[]) , gradientPerturbFractal2(float[]) , or
gradientPerturbFractal3(float[]) ; the default is 1.0. |
void |
setInterpolation(int interpolation)
|
void |
setMutation(float mutation)
Sets the mutation value used by
MUTANT and MUTANT_FRACTAL noise types, which can be any finite
float. |
void |
setNoiseType(int noiseType)
Sets the default type of noise returned by
getConfiguredNoise(float, float) , using one of the following
constants in this class:
VALUE (0), VALUE_FRACTAL (1), PERLIN (2), PERLIN_FRACTAL (3),
SIMPLEX (4), SIMPLEX_FRACTAL (5), CELLULAR (6), WHITE_NOISE (7),
CUBIC (8), CUBIC_FRACTAL (9), FOAM (10), FOAM_FRACTAL (11), HONEY
(12), HONEY_FRACTAL (13), MUTANT (14), or MUTANT_FRACTAL (15). |
void |
setPointHash(IPointHash hash)
Sets the point hash, an object implementing
IPointHash that is used to take 2 or more
coordinates and a seed and produce a usually-random-seeming hash value. |
void |
setSeed(int seed)
Sets the seed used for all noise types, as a long.
|
void |
setSharpness(float sharpness)
Only used with
FOAM , FOAM_FRACTAL , MUTANT , MUTANT_FRACTAL , CUBIC ,
and CUBIC_FRACTAL noise types, this affects how often the noise will produce very high and very low
results (more often with high values of sharpness, such as 1.25 to 2.0),
as opposed to mid-range (more often with low values of sharpness, such as 0.25 to 0.75). |
float |
singleFoam(int seed,
float x,
float y) |
float |
singleFoam(int seed,
float x,
float y,
float z) |
float |
singleFoam(int seed,
float x,
float y,
float z,
float w) |
float |
singleFoam(int seed,
float x,
float y,
float z,
float w,
float u) |
float |
singleFoam(int seed,
float x,
float y,
float z,
float w,
float u,
float v) |
float |
singleFoam(int seed,
float x,
float y,
float z,
float w,
float u,
float v,
float m) |
float |
singleHoney(int seed,
float x,
float y) |
float |
singleHoney(int seed,
float x,
float y,
float z) |
float |
singleHoney(int seed,
float x,
float y,
float z,
float w) |
float |
singleHoney(int seed,
float x,
float y,
float z,
float w,
float u) |
float |
singleHoney(int seed,
float x,
float y,
float z,
float w,
float u,
float v) |
float |
singleSimplex(int seed,
float x,
float y) |
float |
singleSimplex(int seed,
float x,
float y,
float z) |
float |
singleSimplex(int seed,
float x,
float y,
float z,
float w) |
float |
singleSimplex(int seed,
float x,
float y,
float z,
float w,
float u) |
float |
singleSimplex(int seed,
float x,
float y,
float z,
float w,
float u,
float v) |
float |
singleValue(int seed,
float x,
float y) |
float |
singleValue(int seed,
float x,
float y,
float z) |
float |
singleValue(int seed,
float x,
float y,
float z,
float w) |
float |
singleValue(int seed,
float x,
float y,
float z,
float w,
float u) |
float |
singleValue(int seed,
float x,
float y,
float z,
float w,
float u,
float v) |
float |
singleValue(int seed,
float x,
float y,
float z,
float w,
float u,
float v,
float m) |
protected float |
valueNoise(int seed,
float x,
float y)
Produces noise from 0 to 1, instead of the normal -1 to 1.
|
protected float |
valueNoise(int seed,
float x,
float y,
float z)
Produces noise from 0 to 1, instead of the normal -1 to 1.
|
protected float |
valueNoise(int seed,
float x,
float y,
float z,
float w) |
protected float |
valueNoise(int seed,
float x,
float y,
float z,
float w,
float u) |
protected float |
valueNoise(int seed,
float x,
float y,
float z,
float w,
float u,
float v) |
protected float |
valueNoise(int seed,
float x,
float y,
float z,
float w,
float u,
float v,
float m) |
public static final int VALUE
setNoiseType(int)
.public static final int VALUE_FRACTAL
setNoiseType(int)
.public static final int PERLIN
setNoiseType(int)
.public static final int PERLIN_FRACTAL
setNoiseType(int)
.public static final int SIMPLEX
setNoiseType(int)
.public static final int SIMPLEX_FRACTAL
setNoiseType(int)
.public static final int CELLULAR
setNoiseType(int)
.public static final int WHITE_NOISE
setNoiseType(int)
.public static final int CUBIC
setNoiseType(int)
.public static final int CUBIC_FRACTAL
setNoiseType(int)
.public static final int FOAM
setNoiseType(int)
.public static final int FOAM_FRACTAL
setNoiseType(int)
.public static final int HONEY
setNoiseType(int)
.public static final int HONEY_FRACTAL
setNoiseType(int)
.public static final int MUTANT
setNoiseType(int)
.public static final int MUTANT_FRACTAL
setNoiseType(int)
.public static final int LINEAR
setInterpolation(int)
.public static final int HERMITE
setInterpolation(int)
.public static final int QUINTIC
HERMITE
, but doesn't
have any issues with seams.
Meant to be used with setInterpolation(int)
.public static final int FBM
setFractalType(int)
.public static final int BILLOW
setFractalType(int)
.public static final int RIDGED_MULTI
PERLIN_FRACTAL
has mostly ridges along 45-degree angles,
SIMPLEX_FRACTAL
has many ridges along a triangular grid, and so on. FOAM_FRACTAL
and HONEY_FRACTAL
do well with this mode, though, and look something like lightning or
bubbling fluids, respectively. Using FOAM or HONEY will have this look natural, but PERLIN in
particular will look unnatural if the grid is visible.
setFractalType(int)
.public static final int EUCLIDEAN
CELLULAR
noise.
Meant to be used with setCellularDistanceFunction(int)
.public static final int MANHATTAN
CELLULAR
noise.
Meant to be used with setCellularDistanceFunction(int)
.public static final int NATURAL
CELLULAR
noise.
Meant to be used with setCellularDistanceFunction(int)
.public static final int CELL_VALUE
setCellularReturnType(int)
.public static final int NOISE_LOOKUP
setCellularReturnType(int)
. Note that this does not allow configuring an extra
Noise value to use for lookup (anymore); it always uses 3 octaves of SIMPLEX_FRACTAL
with FBM
.public static final int DISTANCE
setCellularReturnType(int)
.public static final int DISTANCE_2
setCellularReturnType(int)
.public static final int DISTANCE_2_ADD
setCellularReturnType(int)
.public static final int DISTANCE_2_SUB
setCellularReturnType(int)
.public static final int DISTANCE_2_MUL
setCellularReturnType(int)
.public static final int DISTANCE_2_DIV
setCellularReturnType(int)
.protected int seed
getSeed()
protected float frequency
getFrequency()
protected int interpolation
getInterpolation()
protected int noiseType
getNoiseType()
protected int octaves
getFractalOctaves()
protected float lacunarity
getFractalLacunarity()
protected float gain
getFractalGain()
protected int fractalType
getFractalType()
protected int cellularDistanceFunction
getCellularDistanceFunction()
protected int cellularReturnType
getCellularReturnType()
protected boolean fractalSpiral
isFractalSpiral()
protected float gradientPerturbAmp
getGradientPerturbAmp()
protected float sharpness
getSharpness()
protected float mutation
getMutation()
protected IPointHash pointHash
getPointHash()
public static final FastNoise instance
getNoiseWithSeed(float, float, int)
rather than changing its settings and using a
method that needs that lasting configuration, like getConfiguredNoise(float, float)
.public static final float F2f
public static final float G2f
public static final float H2f
public static final float F3f
public static final float G3f
public static final float F4f
public static final float G4f
public static final float LIMIT4
protected static final float[][] grad2f
protected static final float[] grad4f
protected static final squidpony.squidmath.FastNoise.Float5[] grad5f
MathExtras.probit(double)
and then
normalizing the resulting 5D vector. Because the R5 sequence is quasi-random (it only very rarely returns clumps
of points that are close-together in both the sequence and in space), the Gaussian points were more likely to be
quasi-random as well, and far fewer point sets needed to be rejected.protected static final squidpony.squidmath.FastNoise.Float6[] grad6f
public FastNoise()
new FastNoise()
, which makes noise with the seed 1337, a default frequency of 1.0f/32.0f, 1
octave of Simplex noise (since this doesn't specify octave count, it always uses 1 even for the
SIMPLEX_FRACTAL noiseType this uses, but you can call setFractalOctaves(int)
later to benefit from the
fractal noiseType), and normal lacunarity and gain (when unspecified, they are 2f and 0.5f).public FastNoise(int seed)
new FastNoise(1337)
, which makes noise with the
seed 1337, a default frequency of 1.0f/32.0f, 1 octave of Simplex noise (since this doesn't specify octave count,
it always uses 1 even for the SIMPLEX_FRACTAL noiseType this uses, but you can call
setFractalOctaves(int)
later to benefit from the fractal noiseType), and normal lacunarity and gain
(when unspecified, they are 2f and 0.5f).seed
- the int seed for the noise, which should significantly affect the produced noisepublic FastNoise(int seed, float frequency)
new FastNoise(1337, 0.02f)
, which makes noise with the seed 1337, a lower
frequency, 1 octave of Simplex noise (since this doesn't specify octave count, it always uses 1 even for the
SIMPLEX_FRACTAL noiseType this uses, but you can call setFractalOctaves(int)
later to benefit from the
fractal noiseType), and normal lacunarity and gain (when unspecified, they are 2f and 0.5f).seed
- the int seed for the noise, which should significantly affect the produced noisefrequency
- the multiplier for all dimensions, which is usually fairly small (1.0f/32.0f is the default)public FastNoise(int seed, float frequency, int noiseType)
new FastNoise(1337, 0.02f, FastNoise.SIMPLEX)
, which makes noise with the seed 1337, a lower
frequency, 1 octave of Simplex noise (since this doesn't specify octave count, it always uses 1 even for
noiseTypes like SIMPLEX_FRACTAL, but using a fractal noiseType can make sense if you call
setFractalOctaves(int)
later), and normal lacunarity and gain (when unspecified, they are 2f and 0.5f).seed
- the int seed for the noise, which should significantly affect the produced noisefrequency
- the multiplier for all dimensions, which is usually fairly small (1.0f/32.0f is the default)noiseType
- the noiseType, which should be a constant from this class (see setNoiseType(int)
)public FastNoise(int seed, float frequency, int noiseType, int octaves)
new FastNoise(1337, 0.02f, FastNoise.SIMPLEX_FRACTAL, 4)
, which makes noise with the seed 1337, a lower
frequency, 4 octaves of Simplex noise, and normal lacunarity and gain (when unspecified, they are 2f and 0.5f).seed
- the int seed for the noise, which should significantly affect the produced noisefrequency
- the multiplier for all dimensions, which is usually fairly small (1.0f/32.0f is the default)noiseType
- the noiseType, which should be a constant from this class (see setNoiseType(int)
)octaves
- how many octaves of noise to use when the noiseType is one of the _FRACTAL typespublic FastNoise(int seed, float frequency, int noiseType, int octaves, float lacunarity, float gain)
new FastNoise(1337, 0.02f, FastNoise.SIMPLEX_FRACTAL, 4, 0.5f, 2f)
, which makes noise with a
lower frequency, 4 octaves of Simplex noise, and the "inverse" effect on how those octaves work (which makes
the extra added octaves be more significant to the final result and also have a lower frequency, while normally
added octaves have a higher frequency and tend to have a minor effect on the large-scale shape of the noise).seed
- the int seed for the noise, which should significantly affect the produced noisefrequency
- the multiplier for all dimensions, which is usually fairly small (1.0f/32.0f is the default)noiseType
- the noiseType, which should be a constant from this class (see setNoiseType(int)
)octaves
- how many octaves of noise to use when the noiseType is one of the _FRACTAL typeslacunarity
- typically 2.0, or 0.5 to change how extra octaves work (inverse mode)gain
- typically 0.5, or 2.0 to change how extra octaves work (inverse mode)public FastNoise(FastNoise other)
other
into this. This uses the same reference to
an IPointHash
set with setPointHash(IPointHash)
and to another FastNoise set with
setCellularNoiseLookup(FastNoise)
, but otherwise everything it copies is a primitive.other
- another FastNoise, which must not be nullprotected static float dotf(float[] g, float x, float y)
public int getSeed()
public void setSeed(int seed)
seed
- a seed as a longpublic void setFrequency(float frequency)
Noise.Noise2D
and similar
interfaces; try setting frequency to 1.0f
if you experience issues.frequency
- the frequency for all noise types, as a positive non-zero floatpublic float getFrequency()
public void setInterpolation(int interpolation)
LINEAR
(0), HERMITE
(1), or QUINTIC
(2). If
this is not called, it defaults to HERMITE. This is used in Value, Perlin, and Position Perturbing, and because
it is used in Value, that makes it also apply to Foam, Honey, and Mutant.interpolation
- an int (0, 1, or 2) corresponding to a constant from this class for an interpolation typepublic int getInterpolation()
LINEAR
(0), HERMITE
(1), or QUINTIC
(2). If this is not called,
it defaults to HERMITE. This is used in Value, Perlin, and Position Perturbing, and because it is used in Value,
that makes it also apply to Foam, Honey, and Mutant.public void setNoiseType(int noiseType)
getConfiguredNoise(float, float)
, using one of the following
constants in this class:
VALUE
(0), VALUE_FRACTAL
(1), PERLIN
(2), PERLIN_FRACTAL
(3),
SIMPLEX
(4), SIMPLEX_FRACTAL
(5), CELLULAR
(6), WHITE_NOISE
(7),
CUBIC
(8), CUBIC_FRACTAL
(9), FOAM
(10), FOAM_FRACTAL
(11), HONEY
(12), HONEY_FRACTAL
(13), MUTANT
(14), or MUTANT_FRACTAL
(15).
If this isn't called, getConfiguredNoise() will default to SIMPLEX_FRACTAL. Note that if you have a fractal noise
type, you can get the corresponding non-fractal noise type by subtracting 1 from the constant this returns. The
reverse is not always true, because Cellular and White Noise have no fractal version.noiseType
- an int from 0 to 15 corresponding to a constant from this class for a noise typepublic int getNoiseType()
getConfiguredNoise(float, float)
, using one of the following
constants in this class:
VALUE
(0), VALUE_FRACTAL
(1), PERLIN
(2), PERLIN_FRACTAL
(3),
SIMPLEX
(4), SIMPLEX_FRACTAL
(5), CELLULAR
(6), WHITE_NOISE
(7),
CUBIC
(8), CUBIC_FRACTAL
(9), FOAM
(10), FOAM_FRACTAL
(11), HONEY
(12), HONEY_FRACTAL
(13), MUTANT
(14), or MUTANT_FRACTAL
(15).
The default is SIMPLEX_FRACTAL. Note that if you have a fractal noise type, you can get the corresponding
non-fractal noise type by subtracting 1 from the constant this returns. The reverse is not always true, because
Cellular and White Noise have no fractal version.public void setFractalOctaves(int octaves)
octaves
- the number of octaves to use for fractal noise types, as a positive non-zero intpublic int getFractalOctaves()
public void setFractalLacunarity(float lacunarity)
lacunarity
- a non-0 float that will be used for the lacunarity of fractal noise types; commonly 2.0 or 0.5public float getFractalLacunarity()
public void setFractalGain(float gain)
gain
- the gain between octaves, as a floatpublic float getFractalGain()
getFractalLacunarity()
, with gain falling as lacunarity rises.
If this wasn't changed, it defaults to 0.5.public void setFractalType(int fractalType)
FBM
(0), BILLOW
(1), or RIDGED_MULTI
(2).
If this hasn't been called, it will use FBM.fractalType
- an int (0, 1, or 2) that corresponds to a constant like FBM
or RIDGED_MULTI
public int getFractalType()
FBM
(0), BILLOW
(1), or RIDGED_MULTI
(2).
The default is FBM.public void setCellularDistanceFunction(int cellularDistanceFunction)
EUCLIDEAN
(0), MANHATTAN
(1), or NATURAL
(2).
If this hasn't been called, it will use EUCLIDEAN.cellularDistanceFunction
- an int that can be 0, 1, or 2, corresponding to a constant from this classpublic int getCellularDistanceFunction()
EUCLIDEAN
(0), MANHATTAN
(1), or NATURAL
(2). If this wasn't changed, it will use
EUCLIDEAN.public void setCellularReturnType(int cellularReturnType)
CELL_VALUE
(0), NOISE_LOOKUP
(1), DISTANCE
(2),
DISTANCE_2
(3), DISTANCE_2_ADD
(4), DISTANCE_2_SUB
(5), DISTANCE_2_MUL
(6),
or DISTANCE_2_DIV
(7). If this isn't called, it will use CELL_VALUE.cellularReturnType
- a constant from this class (see above JavaDoc)public int getCellularReturnType()
CELL_VALUE
(0), NOISE_LOOKUP
(1), DISTANCE
(2), DISTANCE_2
(3),
DISTANCE_2_ADD
(4), DISTANCE_2_SUB
(5), DISTANCE_2_MUL
(6), or
DISTANCE_2_DIV
(7). If this wasn't changed, it will use CELL_VALUE.public void setCellularNoiseLookup(FastNoise noise)
NOISE_LOOKUP
.
There is no default value; this must be called if using noise lookup to set the noise to a non-null value.
The lookup value is acquired through getConfiguredNoise(), so ensure you setNoiseType() on the noise lookup.
Value, Foam, Honey, Perlin, and Simplex are all suggested; White Noise and Cellular are not.noise
- another FastNoise object that should be configured alreadypublic void setGradientPerturbAmp(float gradientPerturbAmp)
gradientPerturb2(float[])
,
gradientPerturb3(float[])
, gradientPerturbFractal2(float[])
, or
gradientPerturbFractal3(float[])
; the default is 1.0.gradientPerturbAmp
- the maximum perturb distance from the original location when using relevant methodspublic float getGradientPerturbAmp()
gradientPerturb2(float[])
,
gradientPerturb3(float[])
, gradientPerturbFractal2(float[])
, or
gradientPerturbFractal3(float[])
; the default is 1.0.public boolean isFractalSpiral()
BILLOW
and RIDGED_MULTI
fractal types, but not
FBM
. It changes VALUE_FRACTAL
, CUBIC_FRACTAL
,
PERLIN_FRACTAL
, and SIMPLEX_FRACTAL
noise types, but not
FOAM_FRACTAL
, MUTANT_FRACTAL
, or HONEY_FRACTAL
because those show no real improvement
with this on. This mode defaults to false if not set.public void setFractalSpiral(boolean fractalSpiral)
BILLOW
and RIDGED_MULTI
fractal types, but not
FBM
. It changes VALUE_FRACTAL
, CUBIC_FRACTAL
,
PERLIN_FRACTAL
, and SIMPLEX_FRACTAL
noise types, but not
FOAM_FRACTAL
, MUTANT_FRACTAL
, or HONEY_FRACTAL
because those show no real improvement
with this on. This mode defaults to false if not set.fractalSpiral
- true to set fractal spiral mode on, false to set it offpublic float getFoamSharpness()
FOAM
, FOAM_FRACTAL
, MUTANT
, MUTANT_FRACTAL
,
CUBIC
, and CUBIC_FRACTAL
noise types, which is usually
around 0.25f to 2.0f, and defaults to 1.0f. High values produce extreme results more often, and
low values produce mid-range values more often.
getSharpness()
.public void setFoamSharpness(float foamSharpness)
FOAM
, FOAM_FRACTAL
, MUTANT
, MUTANT_FRACTAL
, CUBIC
,
and CUBIC_FRACTAL
noise types, this affects how often the noise will produce very high and very low
results (more often with high values of sharpness, such as 1.25 to 2.0),
as opposed to mid-range (more often with low values of sharpness, such as 0.25 to 0.75).
setSharpness(float)
.foamSharpness
- higher results (above 1) tend to produce extremes, lower results (below 1) produce mid-rangepublic float getSharpness()
FOAM
, FOAM_FRACTAL
, MUTANT
, MUTANT_FRACTAL
,
CUBIC
, and CUBIC_FRACTAL
noise types, which is usually
around 0.25f to 2.0f, and defaults to 1.0f. High values produce extreme results more often, and
low values produce mid-range values more often.
getFoamSharpness()
.public void setSharpness(float sharpness)
FOAM
, FOAM_FRACTAL
, MUTANT
, MUTANT_FRACTAL
, CUBIC
,
and CUBIC_FRACTAL
noise types, this affects how often the noise will produce very high and very low
results (more often with high values of sharpness, such as 1.25 to 2.0),
as opposed to mid-range (more often with low values of sharpness, such as 0.25 to 0.75).
setFoamSharpness(float)
.sharpness
- higher results (above 1) tend to produce extremes, lower results (below 1) produce mid-rangepublic float getMutation()
MUTANT
and MUTANT_FRACTAL
noise types, which allows making
small changes to the result when the mutation values are slightly different.public void setMutation(float mutation)
MUTANT
and MUTANT_FRACTAL
noise types, which can be any finite
float. Small changes to the mutation value cause small changes in the result, unlike changes to the seed.mutation
- the mutation value to use, which can be any finite floatpublic IPointHash getPointHash()
IPointHash
that is used to take 2 or more
coordinates and a seed and produce a usually-random-seeming hash value. You may want to use a
flawed IPointHash (one that is not random) for artistic reasons, like
FlawedPointHash.QuiltHash
or FlawedPointHash.CubeHash
, but these mostly work
well when the noise type is CUBIC
or CUBIC_FRACTAL
.
IntPointHash
.IntPointHash
public void setPointHash(IPointHash hash)
IPointHash
that is used to take 2 or more
coordinates and a seed and produce a usually-random-seeming hash value. You may want to use a
flawed IPointHash (one that is not random) for artistic reasons, like
FlawedPointHash.QuiltHash
or FlawedPointHash.CubeHash
, but these mostly work
well when the noise type is CUBIC
or CUBIC_FRACTAL
.
IntPointHash
.hash
- an IPointHash; will be ignored if nullprotected int hash32(int x, int y, int z, int s)
protected int hash256(int x, int y, int s)
protected int hash256(int x, int y, int z, int s)
protected int hash256(int x, int y, int z, int w, int s)
protected int hash256(int x, int y, int z, int w, int u, int s)
protected int hash256(int x, int y, int z, int w, int u, int v, int s)
public double getNoise(double x, double y)
getNoise
in interface Noise.Noise2D
public double getNoiseWithSeed(double x, double y, long seed)
getNoiseWithSeed
in interface Noise.Noise2D
public double getNoise(double x, double y, double z)
getNoise
in interface Noise.Noise3D
public double getNoiseWithSeed(double x, double y, double z, long seed)
getNoiseWithSeed
in interface Noise.Noise3D
public double getNoise(double x, double y, double z, double w)
getNoise
in interface Noise.Noise4D
public double getNoiseWithSeed(double x, double y, double z, double w, long seed)
getNoiseWithSeed
in interface Noise.Noise4D
public double getNoise(double x, double y, double z, double w, double u)
getNoise
in interface Noise.Noise5D
public double getNoiseWithSeed(double x, double y, double z, double w, double u, long seed)
getNoiseWithSeed
in interface Noise.Noise5D
public double getNoise(double x, double y, double z, double w, double u, double v)
getNoise
in interface Noise.Noise6D
public double getNoiseWithSeed(double x, double y, double z, double w, double u, double v, long seed)
getNoiseWithSeed
in interface Noise.Noise6D
public float getNoiseWithSeed(float x, float y, int seed)
public float getNoiseWithSeed(float x, float y, float z, int seed)
public float getNoiseWithSeed(float x, float y, float z, float w, int seed)
public float getNoiseWithSeed(float x, float y, float z, float w, float u, int seed)
public float getNoiseWithSeed(float x, float y, float z, float w, float u, float v, int seed)
protected static float hermiteInterpolator(float t)
protected static float quinticInterpolator(float t)
protected static float cubicLerp(float a, float b, float c, float d, float t)
protected float gradCoord2D(int seed, int x, int y, float xd, float yd)
protected float gradCoord3D(int seed, int x, int y, int z, float xd, float yd, float zd)
protected float gradCoord4D(int seed, int x, int y, int z, int w, float xd, float yd, float zd, float wd)
protected float gradCoord5D(int seed, int x, int y, int z, int w, int u, float xd, float yd, float zd, float wd, float ud)
protected float gradCoord6D(int seed, int x, int y, int z, int w, int u, int v, float xd, float yd, float zd, float wd, float ud, float vd)
protected float rotateX2D(float x, float y)
protected float rotateY2D(float x, float y)
protected float rotateX3D(float x, float y, float z)
protected float rotateY3D(float x, float y, float z)
protected float rotateZ3D(float x, float y, float z)
protected float rotateX4D(float x, float y, float z, float w)
protected float rotateY4D(float x, float y, float z, float w)
protected float rotateZ4D(float x, float y, float z, float w)
protected float rotateW4D(float x, float y, float z, float w)
protected float rotateX5D(float x, float y, float z, float w, float u)
protected float rotateY5D(float x, float y, float z, float w, float u)
protected float rotateZ5D(float x, float y, float z, float w, float u)
protected float rotateW5D(float x, float y, float z, float w, float u)
protected float rotateU5D(float x, float y, float z, float w, float u)
protected float rotateX6D(float x, float y, float z, float w, float u, float v)
protected float rotateY6D(float x, float y, float z, float w, float u, float v)
protected float rotateZ6D(float x, float y, float z, float w, float u, float v)
protected float rotateW6D(float x, float y, float z, float w, float u, float v)
protected float rotateU6D(float x, float y, float z, float w, float u, float v)
protected float rotateV6D(float x, float y, float z, float w, float u, float v)
protected float rotateX7D(float x, float y, float z, float w, float u, float v, float m)
protected float rotateY7D(float x, float y, float z, float w, float u, float v, float m)
protected float rotateZ7D(float x, float y, float z, float w, float u, float v, float m)
protected float rotateW7D(float x, float y, float z, float w, float u, float v, float m)
protected float rotateU7D(float x, float y, float z, float w, float u, float v, float m)
protected float rotateV7D(float x, float y, float z, float w, float u, float v, float m)
protected float rotateM7D(float x, float y, float z, float w, float u, float v, float m)
public float getConfiguredNoise(float x, float y)
setNoiseType(int)
,
setFrequency(float)
, setFractalOctaves(int)
, and setFractalType(int)
, among others,
you can call this method to get the particular variety of noise you specified, in 2D.x
- x position, as a float; the range this should have depends on getFrequency()
y
- y position, as a float; the range this should have depends on getFrequency()
public float getConfiguredNoise(float x, float y, float z)
setNoiseType(int)
,
setFrequency(float)
, setFractalOctaves(int)
, and setFractalType(int)
, among others,
you can call this method to get the particular variety of noise you specified, in 3D.x
- x position, as a float; the range this should have depends on getFrequency()
y
- y position, as a float; the range this should have depends on getFrequency()
z
- z position, as a float; the range this should have depends on getFrequency()
public float getConfiguredNoise(float x, float y, float z, float w)
setNoiseType(int)
,
setFrequency(float)
, setFractalOctaves(int)
, and setFractalType(int)
, among others,
you can call this method to get the particular variety of noise you specified, in 4D.x
- x position, as a float; the range this should have depends on getFrequency()
y
- y position, as a float; the range this should have depends on getFrequency()
z
- z position, as a float; the range this should have depends on getFrequency()
w
- w position, as a float; the range this should have depends on getFrequency()
public float getConfiguredNoise(float x, float y, float z, float w, float u)
setNoiseType(int)
,
setFrequency(float)
, setFractalOctaves(int)
, and setFractalType(int)
, among others,
you can call this method to get the particular variety of noise you specified, in 5D.x
- x position, as a float; the range this should have depends on getFrequency()
y
- y position, as a float; the range this should have depends on getFrequency()
z
- z position, as a float; the range this should have depends on getFrequency()
w
- w position, as a float; the range this should have depends on getFrequency()
u
- u position, as a float; the range this should have depends on getFrequency()
public float getConfiguredNoise(float x, float y, float z, float w, float u, float v)
setNoiseType(int)
,
setFrequency(float)
, setFractalOctaves(int)
, and setFractalType(int)
, among others,
you can call this method to get the particular variety of noise you specified, in 6D.x
- x position, as a float; the range this should have depends on getFrequency()
y
- y position, as a float; the range this should have depends on getFrequency()
z
- z position, as a float; the range this should have depends on getFrequency()
w
- w position, as a float; the range this should have depends on getFrequency()
u
- u position, as a float; the range this should have depends on getFrequency()
v
- v position, as a float; the range this should have depends on getFrequency()
public float getWhiteNoise(float x, float y)
public float getWhiteNoise(float x, float y, float z)
public float getWhiteNoise(float x, float y, float z, float w)
public float getWhiteNoise(float x, float y, float z, float w, float u)
public float getWhiteNoise(float x, float y, float z, float w, float u, float v)
public float getValueFractal(float x, float y)
public float getValue(float x, float y)
public float singleValue(int seed, float x, float y)
protected float valueNoise(int seed, float x, float y)
seed
- x
- y
- public float getValueFractal(float x, float y, float z)
public float getValue(float x, float y, float z)
public float singleValue(int seed, float x, float y, float z)
protected float valueNoise(int seed, float x, float y, float z)
seed
- x
- y
- z
- public float getValueFractal(float x, float y, float z, float w)
public float getValue(float x, float y, float z, float w)
public float singleValue(int seed, float x, float y, float z, float w)
protected float valueNoise(int seed, float x, float y, float z, float w)
public float getValueFractal(float x, float y, float z, float w, float u)
public float getValue(float x, float y, float z, float w, float u)
public float singleValue(int seed, float x, float y, float z, float w, float u)
protected float valueNoise(int seed, float x, float y, float z, float w, float u)
public float getValueFractal(float x, float y, float z, float w, float u, float v)
public float getValue(float x, float y, float z, float w, float u, float v)
public float singleValue(int seed, float x, float y, float z, float w, float u, float v)
protected float valueNoise(int seed, float x, float y, float z, float w, float u, float v)
public float singleValue(int seed, float x, float y, float z, float w, float u, float v, float m)
protected float valueNoise(int seed, float x, float y, float z, float w, float u, float v, float m)
public float getFoam(float x, float y)
public float singleFoam(int seed, float x, float y)
public float getFoamFractal(float x, float y)
public float getFoamFractal(float x, float y, float z)
public float getFoam(float x, float y, float z)
public float singleFoam(int seed, float x, float y, float z)
public float getFoam(float x, float y, float z, float w)
public float singleFoam(int seed, float x, float y, float z, float w)
public float getFoamFractal(float x, float y, float z, float w, float u)
public float getFoam(float x, float y, float z, float w, float u)
public float singleFoam(int seed, float x, float y, float z, float w, float u)
public float getFoamFractal(float x, float y, float z, float w, float u, float v)
public float getFoam(float x, float y, float z, float w, float u, float v)
public float singleFoam(int seed, float x, float y, float z, float w, float u, float v)
public float singleFoam(int seed, float x, float y, float z, float w, float u, float v, float m)
public float getPerlinFractal(float x, float y)
public float getPerlin(float x, float y)
public float getPerlinFractal(float x, float y, float z)
public float getPerlin(float x, float y, float z)
public float getPerlin(float x, float y, float z, float w)
public float getPerlin(float x, float y, float z, float w, float u)
public float getPerlin(float x, float y, float z, float w, float u, float v)
public float getSimplexFractal(float x, float y)
public float layered2D(float x, float y, int seed, int octaves)
x
- y
- seed
- octaves
- public float layered2D(float x, float y, int seed, int octaves, float frequency)
x
- y
- seed
- octaves
- public float layered2D(float x, float y, int seed, int octaves, float frequency, float lacunarity)
x
- y
- seed
- octaves
- public float layered2D(float x, float y, int seed, int octaves, float frequency, float lacunarity, float gain)
x
- y
- seed
- octaves
- public float ridged2D(float x, float y, int seed, int octaves)
x
- y
- seed
- octaves
- public float ridged2D(float x, float y, int seed, int octaves, float frequency)
x
- y
- seed
- octaves
- public float ridged2D(float x, float y, int seed, int octaves, float frequency, float lacunarity)
x
- y
- seed
- any intoctaves
- how many "layers of detail" to generate; at least 1, but note this slows down with many octavesfrequency
- often about 1f / 32f
, but generally adjusted for the use caselacunarity
- when octaves
is 2 or more, this affects the change between layerspublic float getSimplex(float x, float y)
public float singleSimplex(int seed, float x, float y)
public float getSimplexFractal(float x, float y, float z)
public float layered3D(float x, float y, float z, int seed, int octaves)
x
- y
- z
- seed
- octaves
- public float layered3D(float x, float y, float z, int seed, int octaves, float frequency)
x
- y
- z
- seed
- octaves
- public float layered3D(float x, float y, float z, int seed, int octaves, float frequency, float lacunarity)
x
- y
- z
- seed
- octaves
- frequency
- lacunarity
- public float layered3D(float x, float y, float z, int seed, int octaves, float frequency, float lacunarity, float gain)
x
- y
- z
- seed
- octaves
- frequency
- lacunarity
- gain
- public float ridged3D(float x, float y, float z, int seed, int octaves)
x
- y
- z
- seed
- octaves
- public float ridged3D(float x, float y, float z, int seed, int octaves, float frequency)
x
- y
- z
- seed
- octaves
- public float ridged3D(float x, float y, float z, int seed, int octaves, float frequency, float lacunarity)
x
- y
- z
- seed
- any intoctaves
- how many "layers of detail" to generate; at least 1, but note this slows down with many octavesfrequency
- often about 1f / 32f
, but generally adjusted for the use caselacunarity
- when octaves
is 2 or more, this affects the change between layerspublic float getSimplex(float x, float y, float z)
public float singleSimplex(int seed, float x, float y, float z)
public float getSimplexFractal(float x, float y, float z, float w)
public float getSimplex(float x, float y, float z, float w)
public float singleSimplex(int seed, float x, float y, float z, float w)
public float singleSimplex(int seed, float x, float y, float z, float w, float u)
public float getSimplex(float x, float y, float z, float w, float u)
public float getSimplexFractal(float x, float y, float z, float w, float u)
public float singleSimplex(int seed, float x, float y, float z, float w, float u, float v)
public float getSimplex(float x, float y, float z, float w, float u, float v)
public float getSimplexFractal(float x, float y, float z, float w, float u, float v)
public float getCubicFractal(float x, float y)
public float getCubic(float x, float y)
public float getCubicFractal(float x, float y, float z)
public float getCubic(float x, float y, float z)
public float getCubicFractal(float x, float y, float z, float w)
public float getCubic(float x, float y, float z, float w)
public float getCellular(float x, float y, float z)
public float getCellular(float x, float y)
public void gradientPerturb3(float[] v3)
public void gradientPerturbFractal3(float[] v3)
public void gradientPerturb2(float[] v2)
public void gradientPerturbFractal2(float[] v2)
public float getHoney(float x, float y)
public float singleHoney(int seed, float x, float y)
public float getHoneyFractal(float x, float y)
public float getHoneyFractal(float x, float y, float z)
public float getHoney(float x, float y, float z)
public float singleHoney(int seed, float x, float y, float z)
public float getHoney(float x, float y, float z, float w)
public float singleHoney(int seed, float x, float y, float z, float w)
public float getHoneyFractal(float x, float y, float z, float w, float u)
public float getHoney(float x, float y, float z, float w, float u)
public float singleHoney(int seed, float x, float y, float z, float w, float u)
public float getHoneyFractal(float x, float y, float z, float w, float u, float v)
public float getHoney(float x, float y, float z, float w, float u, float v)
public float singleHoney(int seed, float x, float y, float z, float w, float u, float v)
Copyright © Eben Howard 2012–2022. All rights reserved.