Class Billow


  • public class Billow
    extends Module
    Noise module that outputs three-dimensional "billowy" noise.

    This noise module generates "billowy" noise suitable for clouds and rocks.

    This noise module is nearly identical to Perlin except this noise module modifies each octave with an absolute-value function. See the documentation of Perlin for more information.

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

      • DEFAULT_BILLOW_FREQUENCY

        public static final double DEFAULT_BILLOW_FREQUENCY
        Default frequency for the Billow noise module.
        See Also:
        Constant Field Values
      • DEFAULT_BILLOW_LACUNARITY

        public static final double DEFAULT_BILLOW_LACUNARITY
        Default lacunarity for the Billow noise module.
        See Also:
        Constant Field Values
      • DEFAULT_BILLOW_OCTAVE_COUNT

        public static final int DEFAULT_BILLOW_OCTAVE_COUNT
        Default number of octaves for the Billow noise module.
        See Also:
        Constant Field Values
      • DEFAULT_BILLOW_PERSISTENCE

        public static final double DEFAULT_BILLOW_PERSISTENCE
        Default persistence value for the Billow noise module.
        See Also:
        Constant Field Values
      • DEFAULT_BILLOW_QUALITY

        public static final NoiseQuality DEFAULT_BILLOW_QUALITY
        Default noise quality for the Billow noise module.
      • DEFAULT_BILLOW_SEED

        public static final int DEFAULT_BILLOW_SEED
        Default noise seed for the Billow noise module.
        See Also:
        Constant Field Values
      • BILLOW_MAX_OCTAVE

        public static final int BILLOW_MAX_OCTAVE
        Maximum number of octaves for the Billow noise module.
        See Also:
        Constant Field Values
    • Constructor Detail

      • Billow

        public Billow()
        Create a new Billow module, with all fields initialized to their defaults.
    • Method Detail

      • getOctaveCount

        public int getOctaveCount()
        Returns the number of octaves that generate the billowy noise.

        The number of octaves controls the amount of detail in the billowy noise.

        Returns:
        the number of octaves that generate the billowy noise.
        See Also:
        DEFAULT_BILLOW_OCTAVE_COUNT
      • setOctaveCount

        public void setOctaveCount​(int octaveCount)
        Sets the number of octaves that generate the billowy noise.

        The number of octaves controls the amount of detail in the billowy noise.

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

        Parameters:
        octaveCount - the number of octaves, from 1 to BILLOW_MAX_OCTAVE
        Throws:
        IllegalArgumentException - if the octave count is out of bounds.
      • getFrequency

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

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

        public double getLacunarity()
        Get the lacunarity of the billowy noise.

        The lacunarity is the frequency multiplier between successive octaves.

        Returns:
        the lacunarity of the billowy noise
        See Also:
        DEFAULT_BILLOW_LACUNARITY
      • setLacunarity

        public void setLacunarity​(double lacunarity)
        Set the lacunarity of the billowy 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 billowy noise
      • getQuality

        public NoiseQuality getQuality()
        Get the quality of the billowy noise.

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

        Returns:
        the quality of the billowy noise
        See Also:
        DEFAULT_BILLOW_QUALITY
      • setQuality

        public void setQuality​(NoiseQuality quality)
        Sets the quality of the billowy noise.

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

        Parameters:
        quality - the quality of the billowy noise
      • getPersistence

        public double getPersistence()
        Get the persistence value of the billowy noise.

        The persistence value controls the roughness of the billowy noise.

        Returns:
        the persistence value of the billowy noise
        See Also:
        DEFAULT_BILLOW_PERSISTENCE
      • setPersistence

        public void setPersistence​(double persistence)
        Sets the persistence value of the billowy noise.
        Parameters:
        persistence - the persistence value of the billowy noise.

        The persistence value controls the roughness of the billowy noise.

        For best results, set the persistence value to a number between 0.0 and 1.0.

      • getSeed

        public int getSeed()
        Gets the seed used by the billowy-noise function.
        Returns:
        the seed value
        See Also:
        DEFAULT_BILLOW_SEED
      • setSeed

        public void setSeed​(int seed)
        Sets the seed value used by the billowy-noise function.
        Parameters:
        seed - the seed value
      • 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