Package org.bukkit.util.noise
Class SimplexOctaveGenerator
java.lang.Object
org.bukkit.util.noise.OctaveGenerator
org.bukkit.util.noise.SimplexOctaveGenerator
Creates simplex noise through unbiased octaves
-
Field Summary
Fields inherited from class org.bukkit.util.noise.OctaveGenerator
octaves, xScale, yScale, zScale
-
Constructor Summary
ConstructorDescriptionSimplexOctaveGenerator(long seed, int octaves)
Creates a simplex octave generator for the given worldSimplexOctaveGenerator(@NotNull Random rand, int octaves)
Creates a simplex octave generator for the givenRandom
SimplexOctaveGenerator(@NotNull World world, int octaves)
Creates a simplex octave generator for the given world -
Method Summary
Modifier and TypeMethodDescriptiondouble
Gets the scale used for each W-coordinates passeddouble
noise(double x, double y, double z, double w, double frequency, double amplitude)
Generates noise for the 3D coordinates using the specified number of octaves and parametersdouble
noise(double x, double y, double z, double w, double frequency, double amplitude, boolean normalized)
Generates noise for the 3D coordinates using the specified number of octaves and parametersvoid
setScale(double scale)
Sets the scale used for all coordinates passed to this generator.void
setWScale(double scale)
Sets the scale used for each W-coordinates passed
-
Constructor Details
-
SimplexOctaveGenerator
Creates a simplex octave generator for the given world- Parameters:
world
- World to construct this generator foroctaves
- Amount of octaves to create
-
SimplexOctaveGenerator
public SimplexOctaveGenerator(long seed, int octaves)Creates a simplex octave generator for the given world- Parameters:
seed
- Seed to construct this generator foroctaves
- Amount of octaves to create
-
SimplexOctaveGenerator
Creates a simplex octave generator for the givenRandom
- Parameters:
rand
- Random object to construct this generator foroctaves
- Amount of octaves to create
-
-
Method Details
-
setScale
public void setScale(double scale)Description copied from class:OctaveGenerator
Sets the scale used for all coordinates passed to this generator.This is the equivalent to setting each coordinate to the specified value.
- Overrides:
setScale
in classOctaveGenerator
- Parameters:
scale
- New value to scale each coordinate by
-
getWScale
public double getWScale()Gets the scale used for each W-coordinates passed- Returns:
- W scale
-
setWScale
public void setWScale(double scale)Sets the scale used for each W-coordinates passed- Parameters:
scale
- New W scale
-
noise
public double noise(double x, double y, double z, double w, double frequency, double amplitude)Generates noise for the 3D coordinates using the specified number of octaves and parameters- Parameters:
x
- X-coordinatey
- Y-coordinatez
- Z-coordinatew
- W-coordinatefrequency
- How much to alter the frequency by each octaveamplitude
- How much to alter the amplitude by each octave- Returns:
- Resulting noise
-
noise
public double noise(double x, double y, double z, double w, double frequency, double amplitude, boolean normalized)Generates noise for the 3D coordinates using the specified number of octaves and parameters- Parameters:
x
- X-coordinatey
- Y-coordinatez
- Z-coordinatew
- W-coordinatefrequency
- How much to alter the frequency by each octaveamplitude
- How much to alter the amplitude by each octavenormalized
- If true, normalize the value to [-1, 1]- Returns:
- Resulting noise
-