Class PerlinNoiseGenerator
java.lang.Object
org.pushingpixels.radiance.theming.internal.utils.PerlinNoiseGenerator
A class for producing Perlin-inspired noise. The code written by Ken Perlin.
-
Field Summary
FieldsModifier and TypeFieldDescription(package private) static final int[]
Permutations.(package private) static final int[]
Permutations. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription(package private) static double
fade
(double t) Fades the specified value.(package private) static double
grad
(int hash, double x, double y, double z) (package private) static double
lerp
(double t, double a, double b) Interpolates the specified value.static double
noise
(double x, double y, double z) Returns noise for the specified coordinates.
-
Field Details
-
p
static final int[] pPermutations. -
permutation
static final int[] permutationPermutations.
-
-
Constructor Details
-
PerlinNoiseGenerator
public PerlinNoiseGenerator()
-
-
Method Details
-
noise
public static double noise(double x, double y, double z) Returns noise for the specified coordinates.- Parameters:
x
- X coordinate.y
- Y coordinate.z
- Z coordinate.- Returns:
- Noise for the specified coordinates.
-
fade
static double fade(double t) Fades the specified value.- Parameters:
t
- Value to fade.- Returns:
- faded value.
-
lerp
static double lerp(double t, double a, double b) Interpolates the specified value.- Parameters:
t
- Value.a
- Starting interpolation value.b
- Ending interpolation value.- Returns:
- Interpolated value.
-
grad
static double grad(int hash, double x, double y, double z) - Parameters:
hash
-x
-y
-z
-- Returns:
-