Class ScaleBias


  • public class ScaleBias
    extends Module
    Noise module that applies a scaling factor and a bias to the output value from a source module.

    The getValue(double, double, double) method retrieves the output value from the source module, multiplies it with a scaling factor, adds a bias to it, then outputs the value.

    Source Modules
    This module requires one source module.
    • Constructor Detail

      • ScaleBias

        public ScaleBias()
      • ScaleBias

        public ScaleBias​(Module source)
        Create a new ScaleBias module with the source modules pre-configured.
        Parameters:
        source - the input module
    • Method Detail

      • getBias

        public double getBias()
        Get the bias to apply to the scaled output value from the source module.

        The getValue(double, double, double) method retrieves the output value from the source module, multiplies it with a scaling factor, adds a bias to it, then outputs the value.

        Returns:
        the bias to apply
      • setBias

        public void setBias​(double bias)
        Set the bias to apply to the scaled output value from the source module.

        The getValue(double, double, double) method retrieves the output value from the source module, multiplies it with a scaling factor, adds a bias to it, then outputs the value.

        Parameters:
        bias - the bias to apply
      • getScale

        public double getScale()
        Get the scaling factor to apply to the output value from the source module.

        The getValue(double, double, double) method retrieves the output value from the source module, multiplies it with a scaling factor, adds a bias to it, then outputs the value.

        Returns:
        the scaling factor to apply
      • setScale

        public void setScale​(double scale)
        Set the scaling factor to apply to the output value from the source module.

        The getValue(double, double, double) method retrieves the output value from the source module, multiplies it with a scaling factor, adds a bias to it, then outputs the value.

        Parameters:
        scale - the scaling factor to apply
      • 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