Package org.bukkit.util.noise
Class NoiseGenerator
java.lang.Object
org.bukkit.util.noise.NoiseGenerator
- Direct Known Subclasses:
- PerlinNoiseGenerator
Base class for all noise generators
- 
Field SummaryFields
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionprotected static doublefade(double x) static intfloor(double x) Speedy floor, faster than (int)Math.floor(x)protected static doublegrad(int hash, double x, double y, double z) protected static doublelerp(double x, double y, double z) doublenoise(double x) Computes and returns the 1D noise for the given coordinate in 1D spacedoublenoise(double x, double y) Computes and returns the 2D noise for the given coordinates in 2D spaceabstract doublenoise(double x, double y, double z) Computes and returns the 3D noise for the given coordinates in 3D spacedoublenoise(double x, double y, double z, int octaves, double frequency, double amplitude) Generates noise for the 3D coordinates using the specified number of octaves and parametersdoublenoise(double x, double y, double z, int octaves, double frequency, double amplitude, boolean normalized) Generates noise for the 3D coordinates using the specified number of octaves and parametersdoublenoise(double x, double y, int octaves, double frequency, double amplitude) Generates noise for the 2D coordinates using the specified number of octaves and parametersdoublenoise(double x, double y, int octaves, double frequency, double amplitude, boolean normalized) Generates noise for the 2D coordinates using the specified number of octaves and parametersdoublenoise(double x, int octaves, double frequency, double amplitude) Generates noise for the 1D coordinates using the specified number of octaves and parametersdoublenoise(double x, int octaves, double frequency, double amplitude, boolean normalized) Generates noise for the 1D coordinates using the specified number of octaves and parameters
- 
Field Details- 
permprotected final int[] perm
- 
offsetXprotected double offsetX
- 
offsetYprotected double offsetY
- 
offsetZprotected double offsetZ
 
- 
- 
Constructor Details- 
NoiseGeneratorpublic NoiseGenerator()
 
- 
- 
Method Details- 
floorpublic static int floor(double x) Speedy floor, faster than (int)Math.floor(x)- Parameters:
- x- Value to floor
- Returns:
- Floored value
 
- 
fadeprotected static double fade(double x) 
- 
lerpprotected static double lerp(double x, double y, double z) 
- 
gradprotected static double grad(int hash, double x, double y, double z) 
- 
noisepublic double noise(double x) Computes and returns the 1D noise for the given coordinate in 1D space- Parameters:
- x- X coordinate
- Returns:
- Noise at given location, from range -1 to 1
 
- 
noisepublic double noise(double x, double y) Computes and returns the 2D noise for the given coordinates in 2D space- Parameters:
- x- X coordinate
- y- Y coordinate
- Returns:
- Noise at given location, from range -1 to 1
 
- 
noisepublic abstract double noise(double x, double y, double z) Computes and returns the 3D noise for the given coordinates in 3D space- Parameters:
- x- X coordinate
- y- Y coordinate
- z- Z coordinate
- Returns:
- Noise at given location, from range -1 to 1
 
- 
noisepublic double noise(double x, int octaves, double frequency, double amplitude) Generates noise for the 1D coordinates using the specified number of octaves and parameters- Parameters:
- x- X-coordinate
- octaves- Number of octaves to use
- frequency- How much to alter the frequency by each octave
- amplitude- How much to alter the amplitude by each octave
- Returns:
- Resulting noise
 
- 
noisepublic double noise(double x, int octaves, double frequency, double amplitude, boolean normalized) Generates noise for the 1D coordinates using the specified number of octaves and parameters- Parameters:
- x- X-coordinate
- octaves- Number of octaves to use
- frequency- How much to alter the frequency by each octave
- amplitude- How much to alter the amplitude by each octave
- normalized- If true, normalize the value to [-1, 1]
- Returns:
- Resulting noise
 
- 
noisepublic double noise(double x, double y, int octaves, double frequency, double amplitude) Generates noise for the 2D coordinates using the specified number of octaves and parameters- Parameters:
- x- X-coordinate
- y- Y-coordinate
- octaves- Number of octaves to use
- frequency- How much to alter the frequency by each octave
- amplitude- How much to alter the amplitude by each octave
- Returns:
- Resulting noise
 
- 
noisepublic double noise(double x, double y, int octaves, double frequency, double amplitude, boolean normalized) Generates noise for the 2D coordinates using the specified number of octaves and parameters- Parameters:
- x- X-coordinate
- y- Y-coordinate
- octaves- Number of octaves to use
- frequency- How much to alter the frequency by each octave
- amplitude- How much to alter the amplitude by each octave
- normalized- If true, normalize the value to [-1, 1]
- Returns:
- Resulting noise
 
- 
noisepublic double noise(double x, double y, double z, int octaves, double frequency, double amplitude) Generates noise for the 3D coordinates using the specified number of octaves and parameters- Parameters:
- x- X-coordinate
- y- Y-coordinate
- z- Z-coordinate
- octaves- Number of octaves to use
- frequency- How much to alter the frequency by each octave
- amplitude- How much to alter the amplitude by each octave
- Returns:
- Resulting noise
 
- 
noisepublic double noise(double x, double y, double z, int octaves, double frequency, double amplitude, boolean normalized) Generates noise for the 3D coordinates using the specified number of octaves and parameters- Parameters:
- x- X-coordinate
- y- Y-coordinate
- z- Z-coordinate
- octaves- Number of octaves to use
- frequency- How much to alter the frequency by each octave
- amplitude- How much to alter the amplitude by each octave
- normalized- If true, normalize the value to [-1, 1]
- Returns:
- Resulting noise
 
 
-