Package org.bukkit.util.noise
Class SimplexNoiseGenerator
java.lang.Object
org.bukkit.util.noise.NoiseGenerator
org.bukkit.util.noise.PerlinNoiseGenerator
org.bukkit.util.noise.SimplexNoiseGenerator
public class SimplexNoiseGenerator extends PerlinNoiseGenerator
Generates simplex-based noise.
This is a modified version of the freely published version in the paper by Stefan Gustavson at http://staffwww.itn.liu.se/~stegu/simplexnoise/simplexnoise.pdf
-
Field Summary
Fields Modifier and Type Field Description protected static double
F2
protected static double
F3
protected static double
F4
protected static double
G2
protected static double
G22
protected static double
G3
protected static double
G4
protected static double
G42
protected static double
G43
protected static double
G44
protected static int[][]
grad4
protected double
offsetW
protected static int[][]
simplex
protected static double
SQRT_3
protected static double
SQRT_5
-
Constructor Summary
Constructors Modifier Constructor Description protected
SimplexNoiseGenerator()
SimplexNoiseGenerator(long seed)
Creates a seeded simplex noise generator for the given seedSimplexNoiseGenerator(Random rand)
Creates a seeded simplex noise generator with the given RandomSimplexNoiseGenerator(World world)
Creates a seeded simplex noise generator for the given world -
Method Summary
Modifier and Type Method Description protected static double
dot(int[] g, double x, double y)
protected static double
dot(int[] g, double x, double y, double z)
protected static double
dot(int[] g, double x, double y, double z, double w)
static SimplexNoiseGenerator
getInstance()
Gets the singleton unseeded instance of this generatorstatic double
getNoise(double xin)
Computes and returns the 1D unseeded simplex noise for the given coordinates in 1D spacestatic double
getNoise(double xin, double yin)
Computes and returns the 2D unseeded simplex noise for the given coordinates in 2D spacestatic double
getNoise(double xin, double yin, double zin)
Computes and returns the 3D unseeded simplex noise for the given coordinates in 3D spacestatic double
getNoise(double x, double y, double z, double w)
Computes and returns the 4D simplex noise for the given coordinates in 4D spacedouble
noise(double xin, double yin)
Computes and returns the 2D noise for the given coordinates in 2D spacedouble
noise(double xin, double yin, double zin)
Computes and returns the 3D noise for the given coordinates in 3D spacedouble
noise(double x, double y, double z, double w)
Computes and returns the 4D simplex noise for the given coordinates in 4D spaceMethods inherited from class org.bukkit.util.noise.PerlinNoiseGenerator
getNoise, getNoise, getNoise
-
Field Details
-
SQRT_3
protected static final double SQRT_3 -
SQRT_5
protected static final double SQRT_5 -
F2
protected static final double F2 -
G2
protected static final double G2 -
G22
protected static final double G22 -
F3
protected static final double F3- See Also:
- Constant Field Values
-
G3
protected static final double G3- See Also:
- Constant Field Values
-
F4
protected static final double F4 -
G4
protected static final double G4 -
G42
protected static final double G42 -
G43
protected static final double G43 -
G44
protected static final double G44 -
grad4
protected static final int[][] grad4 -
simplex
protected static final int[][] simplex -
offsetW
protected double offsetW
-
-
Constructor Details
-
SimplexNoiseGenerator
protected SimplexNoiseGenerator() -
SimplexNoiseGenerator
Creates a seeded simplex noise generator for the given world- Parameters:
world
- World to construct this generator for
-
SimplexNoiseGenerator
public SimplexNoiseGenerator(long seed)Creates a seeded simplex noise generator for the given seed- Parameters:
seed
- Seed to construct this generator for
-
SimplexNoiseGenerator
Creates a seeded simplex noise generator with the given Random- Parameters:
rand
- Random to construct with
-
-
Method Details
-
dot
-
dot
-
dot
-
getNoise
public static double getNoise(double xin)Computes and returns the 1D unseeded simplex noise for the given coordinates in 1D space- Parameters:
xin
- X coordinate- Returns:
- Noise at given location, from range -1 to 1
-
getNoise
public static double getNoise(double xin, double yin)Computes and returns the 2D unseeded simplex noise for the given coordinates in 2D space- Parameters:
xin
- X coordinateyin
- Y coordinate- Returns:
- Noise at given location, from range -1 to 1
-
getNoise
public static double getNoise(double xin, double yin, double zin)Computes and returns the 3D unseeded simplex noise for the given coordinates in 3D space- Parameters:
xin
- X coordinateyin
- Y coordinatezin
- Z coordinate- Returns:
- Noise at given location, from range -1 to 1
-
getNoise
public static double getNoise(double x, double y, double z, double w)Computes and returns the 4D simplex noise for the given coordinates in 4D space- Parameters:
x
- X coordinatey
- Y coordinatez
- Z coordinatew
- W coordinate- Returns:
- Noise at given location, from range -1 to 1
-
noise
public double noise(double xin, double yin, double zin)Description copied from class:NoiseGenerator
Computes and returns the 3D noise for the given coordinates in 3D space- Overrides:
noise
in classPerlinNoiseGenerator
- Parameters:
xin
- X coordinateyin
- Y coordinatezin
- Z coordinate- Returns:
- Noise at given location, from range -1 to 1
-
noise
public double noise(double xin, double yin)Description copied from class:NoiseGenerator
Computes and returns the 2D noise for the given coordinates in 2D space- Overrides:
noise
in classNoiseGenerator
- Parameters:
xin
- X coordinateyin
- Y coordinate- Returns:
- Noise at given location, from range -1 to 1
-
noise
public double noise(double x, double y, double z, double w)Computes and returns the 4D simplex noise for the given coordinates in 4D space- Parameters:
x
- X coordinatey
- Y coordinatez
- Z coordinatew
- W coordinate- Returns:
- Noise at given location, from range -1 to 1
-
getInstance
Gets the singleton unseeded instance of this generator- Returns:
- Singleton
-