public class Noise extends java.lang.Object implements Function1D, Function2D, Function3D
Modifier and Type | Field and Description |
---|---|
(package private) static float[] |
g1 |
(package private) static float[][] |
g2 |
(package private) static float[][] |
g3 |
(package private) static int[] |
p |
(package private) static boolean |
start |
Constructor and Description |
---|
Noise() |
Modifier and Type | Method and Description |
---|---|
float |
evaluate(float x)
Compute 1-dimensional Perlin noise.
|
float |
evaluate(float x,
float y)
Compute 2-dimensional Perlin noise.
|
float |
evaluate(float x,
float y,
float z)
Compute 3-dimensional Perlin noise.
|
static float[] |
findRange(Function1D f,
float[] minmax)
Returns the minimum and maximum of a number of random values
of the given function.
|
static float[] |
findRange(Function2D f,
float[] minmax)
Returns the minimum and maximum of a number of random values
of the given function.
|
static float |
lerp(float t,
float a,
float b) |
static float |
noise1(float x)
Compute 1-dimensional Perlin noise.
|
static float |
noise2(float x,
float y)
Compute 2-dimensional Perlin noise.
|
static float |
noise3(float x,
float y,
float z)
Compute 3-dimensional Perlin noise.
|
(package private) static void |
normalize3(float[] v) |
static float |
turbulence2(float x,
float y,
float octaves)
Compute turbulence using Perlin noise.
|
static float |
turbulence3(float x,
float y,
float z,
float octaves)
Compute turbulence using Perlin noise.
|
static int[] p
static float[][] g3
static float[][] g2
static float[] g1
static boolean start
public float evaluate(float x)
evaluate
in interface Function1D
x
- the x valuepublic float evaluate(float x, float y)
evaluate
in interface Function2D
x
- the x coordinatey
- the y coordinatepublic float evaluate(float x, float y, float z)
evaluate
in interface Function3D
x
- the x coordinatey
- the y coordinatey
- the y coordinatepublic static float turbulence2(float x, float y, float octaves)
x
- the x valuey
- the y valueoctaves
- number of octaves of turbulencepublic static float turbulence3(float x, float y, float z, float octaves)
x
- the x valuey
- the y valuez
- the z valueoctaves
- number of octaves of turbulencepublic static float noise1(float x)
x
- the x valuepublic static float noise2(float x, float y)
x
- the x coordinatey
- the y coordinatepublic static float noise3(float x, float y, float z)
x
- the x coordinatey
- the y coordinatez
- the z coordinatepublic static float lerp(float t, float a, float b)
static void normalize3(float[] v)
public static float[] findRange(Function1D f, float[] minmax)
f
- The 1D functionminmax
- An array of two floatspublic static float[] findRange(Function2D f, float[] minmax)
f
- The two dimensional functionminmax
- An array of two floats