Class RidgedMultiSimplex


  • public class RidgedMultiSimplex
    extends Module
    Generates ridged Simplex-style noise.

    The base Simplex uses a different formula but produces a similar appearance to classic Simplex.

    The default lattice orientation is LatticeOrientation.XZ_BEFORE_Y. See LatticeOrientation for recommended usage.

    Source Modules
    This module does not require any source modules.
    • Constructor Detail

      • RidgedMultiSimplex

        public RidgedMultiSimplex()
    • Method Detail

      • getFrequency

        public double getFrequency()
        Get the frequency of the first octave.
        Returns:
        the frequency of the first octave
        See Also:
        DEFAULT_RIDGED_FREQUENCY
      • setFrequency

        public void setFrequency​(double frequency)
        Set the frequency of the first octave.
        Parameters:
        frequency - the frequency of the first octave
      • getLacunarity

        public double getLacunarity()
        Get the lacunarity of the ridged-multifractal noise.
        Returns:
        the lacunarity of the ridged-multifractal noise.
        See Also:
        DEFAULT_RIDGED_LACUNARITY
      • setLacunarity

        public void setLacunarity​(double lacunarity)
        Sets the lacunarity of the ridged-multifractal 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 ridged-multifractal noise
      • setLatticeOrientation

        public void setLatticeOrientation​(LatticeOrientation latticeOrientation)
        Set the lattice orientation for the Simplex noise.
        Parameters:
        latticeOrientation - the lattice orientation
      • setNoiseQuality

        public void setNoiseQuality​(NoiseQualitySimplex noiseQuality)
        Set the quality of the ridged-multifractal noise.

        See NoiseQualitySimplex for definitions of the various coherent-noise qualities.

        Parameters:
        noiseQuality - the quality of the ridged-multifractal noise
      • getOctaveCount

        public int getOctaveCount()
        Get the number of octaves that generate the ridged-multifractal noise.

        The number of octaves controls the amount of detail in the ridged-multifractal noise.

        Returns:
        the number of octaves that generate the ridged-multifractal noise
        See Also:
        DEFAULT_RIDGED_OCTAVE_COUNT
      • setOctaveCount

        public void setOctaveCount​(int octaveCount)
        Set the number of octaves that generate the ridged-multifractal noise.

        The number of octaves must be between 1 and RIDGED_MAX_OCTAVE

        The number of octaves controls the amount of detail in the ridged-multifractal noise.

        The larger the number of octaves, the more time required to calculate the ridged-multifractal noise value.

        Parameters:
        octaveCount - the number of octaves that generate the ridged-multifractal noise
        Throws:
        IllegalArgumentException - if the octave count is larger than RIDGED_MAX_OCTAVE
      • getSeed

        public int getSeed()
        Get the seed value used by the ridged-multifractal noise function.
        Returns:
        the seed value
        See Also:
        DEFAULT_RIDGED_SEED
      • setSeed

        public void setSeed​(int seed)
        Set the seed value used by the ridged-multifractal noise function.
        Parameters:
        seed - the seed value
      • getMaxValue

        public double getMaxValue()
        Returns the maximum value the RidgedMultiSimplex module can output in its current configuration.
        Returns:
        The maximum possible value for getValue(double, double, double) to return
      • getValue

        public double getValue​(double x,
                               double y,
                               double z)
        Description copied from class: Module
        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 Module.setSourceModule(int, Module) method. If these source modules are not connected, this method will throw a NoModuleException.

        To determine the number of source modules required by this noise module, call the Module.getSourceModuleCount() method.

        Specified by:
        getValue in class Module
        Parameters:
        x - the x coordinate of the input value
        y - the y coordinate of the input value
        z - the z coordinate of the input value
        Returns:
        the output value