The base Simplex uses a different formula but produces a similar appearance to classic Simplex.
Default lattice orientation is LatticeOrientation.XZ_BEFORE_Y
. See
LatticeOrientation
for recommended usage.
- Source Modules
- This module does not require any source modules.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final double
Default frequency for theSimplex
noise module.static final double
Default lacunarity for theSimplex
noise module.static final int
Default number of octaves for theSimplex
noise module.static final LatticeOrientation
Default lattice orientation for theSimplex
noise module.static final double
Default persistence value for theSimplex
noise module.static final NoiseQualitySimplex
Default noise quality for theSimplex
noise module.static final int
Default noise seed for theSimplex
noise module.static final int
Maximum number of octaves for theSimplex
noise module.Fields inherited from class org.spongepowered.noise.module.NoiseModule
sourceModule
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiondouble
Get the frequency of the first octave.double
get
(double x, double y, double z) Generates an output value given the coordinates of the specified input value.double
Get the lacunarity of the Simplex noise.Get the lattice orientation for the Simplex noise.double
maxValue()
Returns the maximum value the simplex module can output in its current configuration.Get the quality of the Simplex noise.int
Get the number of octaves that generate the Simplex noise.double
Get the persistence value of the Simplex noise.int
seed()
Get the seed value used by the Simplex noise function.void
setFrequency
(double frequency) Set the frequency of the first octave.void
setLacunarity
(double lacunarity) Sets the lacunarity of the Simplex noise.void
setLatticeOrientation
(LatticeOrientation latticeOrientation) Set the lattice orientation for the Simplex noise.void
setNoiseQuality
(NoiseQualitySimplex noiseQuality) Set the quality of the Simplex noise.void
setOctaveCount
(int octaveCount) Set the number of octaves that generate the Simplex noise.void
setPersistence
(double persistence) Sets the persistence value of the Simplex noise.void
setSeed
(int seed) Set the seed value used by the Simplex-noise function.Methods inherited from class org.spongepowered.noise.module.NoiseModule
setSourceModule, sourceModule, sourceModuleCount
-
Field Details
-
DEFAULT_SIMPLEX_FREQUENCY
public static final double DEFAULT_SIMPLEX_FREQUENCYDefault frequency for theSimplex
noise module.- See Also:
-
DEFAULT_SIMPLEX_LACUNARITY
public static final double DEFAULT_SIMPLEX_LACUNARITYDefault lacunarity for theSimplex
noise module.- See Also:
-
DEFAULT_SIMPLEX_OCTAVE_COUNT
public static final int DEFAULT_SIMPLEX_OCTAVE_COUNTDefault number of octaves for theSimplex
noise module.- See Also:
-
DEFAULT_SIMPLEX_PERSISTENCE
public static final double DEFAULT_SIMPLEX_PERSISTENCEDefault persistence value for theSimplex
noise module.- See Also:
-
DEFAULT_SIMPLEX_ORIENTATION
Default lattice orientation for theSimplex
noise module. -
DEFAULT_SIMPLEX_QUALITY
Default noise quality for theSimplex
noise module. -
DEFAULT_SIMPLEX_SEED
public static final int DEFAULT_SIMPLEX_SEEDDefault noise seed for theSimplex
noise module.- See Also:
-
SIMPLEX_MAX_OCTAVE
public static final int SIMPLEX_MAX_OCTAVEMaximum number of octaves for theSimplex
noise module.- See Also:
-
-
Constructor Details
-
Simplex
public Simplex()
-
-
Method Details
-
frequency
public double frequency()Get the frequency of the first octave.- Returns:
- the frequency of the first octave
- See Also:
-
setFrequency
public void setFrequency(double frequency) Set the frequency of the first octave.- Parameters:
frequency
- the frequency of the first octave
-
lacunarity
public double lacunarity()Get the lacunarity of the Simplex noise.The lacunarity is the frequency multiplier between successive octaves.
- Returns:
- the lacunarity of the Simplex noise
- See Also:
-
setLacunarity
public void setLacunarity(double lacunarity) Sets the lacunarity of the Simplex noise.The lacunarity is the frequency multiplier between successive octaves.
For best results, set the lacunarity to a number between 1.5 and 3.5.
- Parameters:
lacunarity
- the lacunarity of the Simplex noise
-
latticeOrientation
Get the lattice orientation for the Simplex noise.- Returns:
- the lattice orientation
- See Also:
-
setLatticeOrientation
Set the lattice orientation for the Simplex noise.- Parameters:
latticeOrientation
- the lattice orientation
-
noiseQuality
Get the quality of the Simplex noise.See
NoiseQualitySimplex
for definitions of the various coherent-noise qualities.- Returns:
- the quality of the Simplex noise
- See Also:
-
setNoiseQuality
Set the quality of the Simplex noise.See
NoiseQualitySimplex
for definitions of the various coherent-noise qualities.- Parameters:
noiseQuality
- the quality of the Simplex noise
-
octaveCount
public int octaveCount()Get the number of octaves that generate the Simplex noise.The number of octaves controls the amount of detail in the Simplex noise.
- Returns:
- the number of octaves that generate the Simplex noise
- See Also:
-
setOctaveCount
public void setOctaveCount(int octaveCount) Set the number of octaves that generate the Simplex noise.The octave count must be between 1 and
SIMPLEX_MAX_OCTAVE
, inclusive.The number of octaves controls the amount of detail in the Simplex noise.
The larger the number of octaves, the more time required to calculate the Simplex-noise value.
- Parameters:
octaveCount
- the number of octaves that generate the Simplex noise- Throws:
IllegalArgumentException
- if the octave count is out of bounds
-
persistence
public double persistence()Get the persistence value of the Simplex noise.The persistence value controls the roughness of the Simplex noise.
- Returns:
- the persistence value
- See Also:
-
setPersistence
public void setPersistence(double persistence) Sets the persistence value of the Simplex noise.The persistence value controls the roughness of the Simplex noise.
For best results, set the persistence to a number between 0.0 and 1.0.
- Parameters:
persistence
- the persistence value of the Simplex noise
-
seed
public int seed()Get the seed value used by the Simplex noise function.- Returns:
- the seed value
- See Also:
-
setSeed
public void setSeed(int seed) Set the seed value used by the Simplex-noise function.- Parameters:
seed
- the seed value
-
maxValue
public double maxValue()Returns the maximum value the simplex module can output in its current configuration.- Returns:
- The maximum possible value for
get(double, double, double)
to return
-
get
public double get(double x, double y, double z) Description copied from class:NoiseModule
Generates an output value given the coordinates of the specified input value.All source modules required by this module must have been connected with the
NoiseModule.setSourceModule(int, NoiseModule)
method. If these source modules are not connected, this method will throw aNoModuleException
.To determine the number of source modules required by this noise module, call the
NoiseModule.sourceModuleCount()
method.- Specified by:
get
in classNoiseModule
- Parameters:
x
- thex
coordinate of the input valuey
- they
coordinate of the input valuez
- thez
coordinate of the input value- Returns:
- the output value
-