public class Noise extends Object implements Function1D, Function2D, Function3D
Modifier and Type | Field and Description |
---|---|
private static int |
B |
private static int |
BM |
(package private) static float[] |
g1 |
(package private) static float[][] |
g2 |
(package private) static float[][] |
g3 |
private static int |
N |
(package private) static int[] |
p |
private static Random |
randomGenerator |
(package private) static boolean |
start |
Constructor and Description |
---|
Noise() |
Modifier and Type | Method and Description |
---|---|
float |
evaluate(float x) |
float |
evaluate(float x,
float y) |
float |
evaluate(float x,
float y,
float z) |
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.
|
private static void |
init() |
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.
|
private static void |
normalize2(float[] v) |
(package private) static void |
normalize3(float[] v) |
private static int |
random() |
private static float |
sCurve(float t) |
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.
|
private static Random randomGenerator
private static final int B
private static final int BM
private static final int N
static int[] p
static float[][] g3
static float[][] g2
static float[] g1
static boolean start
public Noise()
public float evaluate(float x)
evaluate
in interface Function1D
public float evaluate(float x, float y)
evaluate
in interface Function2D
public float evaluate(float x, float y, float z)
evaluate
in interface Function3D
public 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 valueoctaves
- number of octaves of turbulenceprivate static float sCurve(float t)
public 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 coordinatey
- the y coordinatepublic static float lerp(float t, float a, float b)
private static void normalize2(float[] v)
static void normalize3(float[] v)
private static int random()
private static void init()
public static float[] findRange(Function1D f, float[] minmax)
public static float[] findRange(Function2D f, float[] minmax)
WebARTS Library Licensed Under the GNU - General Public License. Other Libraries licensed under their respective Open Source Licenses