Package net.glowstone.util.noise
Class SimplexNoise
java.lang.Object
org.bukkit.util.noise.NoiseGenerator
org.bukkit.util.noise.PerlinNoiseGenerator
net.glowstone.util.noise.PerlinNoise
net.glowstone.util.noise.SimplexNoise
A speed-improved simplex noise algorithm.
Based on example code by Stefan Gustavson (stegu@itn.liu.se). Optimisations by Peter Eastman (peastman@drizzle.stanford.edu). Better rank ordering method by Stefan Gustavson in 2012.
This could be sped up even further, but it's useful as is.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static final double
protected static final double
protected static final double
protected static final double
protected static final double
protected static final double
protected static final double
protected final int[]
protected static final double
Fields inherited from class org.bukkit.util.noise.NoiseGenerator
offsetX, offsetY, offsetZ, perm
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected static double
dot
(net.glowstone.util.noise.SimplexNoise.Grad g, double x, double y) protected static double
dot
(net.glowstone.util.noise.SimplexNoise.Grad g, double x, double y, double z) static int
floor
(double x) protected double[]
get2dNoise
(double[] noise, double x, double z, int sizeX, int sizeY, double scaleX, double scaleY, double amplitude) protected double[]
get3dNoise
(double[] noise, double x, double y, double z, int sizeX, int sizeY, int sizeZ, double scaleX, double scaleY, double scaleZ, double amplitude) double
noise
(double xin, double yin) double
noise
(double xin, double yin, double zin) Methods inherited from class net.glowstone.util.noise.PerlinNoise
getNoise
Methods inherited from class org.bukkit.util.noise.PerlinNoiseGenerator
getInstance, getNoise, getNoise, getNoise, getNoise, getNoise, getNoise
Methods inherited from class org.bukkit.util.noise.NoiseGenerator
fade, grad, lerp, noise, noise, noise, noise, noise, noise, noise
-
Field Details
-
SQRT_3
protected static final double SQRT_3- See Also:
-
F2
protected static final double F2- See Also:
-
G2
protected static final double G2- See Also:
-
G22
protected static final double G22- See Also:
-
F3
protected static final double F3- See Also:
-
G3
protected static final double G3- See Also:
-
G32
protected static final double G32- See Also:
-
G33
protected static final double G33- See Also:
-
permMod12
protected final int[] permMod12
-
-
Constructor Details
-
SimplexNoise
Creates a simplex noise generator.- Parameters:
rand
- the PRNG to use
-
-
Method Details
-
floor
public static int floor(double x) -
dot
protected static double dot(net.glowstone.util.noise.SimplexNoise.Grad g, double x, double y) -
dot
protected static double dot(net.glowstone.util.noise.SimplexNoise.Grad g, double x, double y, double z) -
get2dNoise
protected double[] get2dNoise(double[] noise, double x, double z, int sizeX, int sizeY, double scaleX, double scaleY, double amplitude) - Overrides:
get2dNoise
in classPerlinNoise
-
get3dNoise
protected double[] get3dNoise(double[] noise, double x, double y, double z, int sizeX, int sizeY, int sizeZ, double scaleX, double scaleY, double scaleZ, double amplitude) - Overrides:
get3dNoise
in classPerlinNoise
-
noise
public double noise(double xin, double yin) - Overrides:
noise
in classorg.bukkit.util.noise.NoiseGenerator
-
noise
public double noise(double xin, double yin, double zin) - Overrides:
noise
in classorg.bukkit.util.noise.PerlinNoiseGenerator
-