Class ScalePoint


  • public class ScalePoint
    extends Module
    Noise module that scales the coordinates of the input value before returning the output value from a source module.

    The getValue(double, double, double) method multiplies the (x, y, z) coordinates of the input value with a scaling factor before returning the output value from the source module.

    To set the scaling factor, call the setScale(double) method. To set the scaling factor to apply to the individual x, y, or z coordinates, call the setXScale(double), setYScale(double), or setZScale(double) methods, respectively.

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

      • DEFAULT_SCALE_POINT_X

        public static final double DEFAULT_SCALE_POINT_X
        Default scaling factor applied to the x coordinate for the ScalePoint noise module.
        See Also:
        Constant Field Values
      • DEFAULT_SCALE_POINT_Y

        public static final double DEFAULT_SCALE_POINT_Y
        Default scaling factor applied to the y coordinate for the ScalePoint noise module.
        See Also:
        Constant Field Values
      • DEFAULT_SCALE_POINT_Z

        public static final double DEFAULT_SCALE_POINT_Z
        Default scaling factor applied to the z coordinate for the ScalePoint noise module.
        See Also:
        Constant Field Values
    • Constructor Detail

      • ScalePoint

        public ScalePoint()
      • ScalePoint

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

      • getXScale

        public double getXScale()
        Get the scaling factor applied to the x coordinate of the input value.
        Returns:
        the scaling factor applied to the x coordinate
        See Also:
        DEFAULT_SCALE_POINT_X
      • setXScale

        public void setXScale​(double xScale)
        Set the scaling factor to apply to the x coordinate of the input value.

        The getValue(double, double, double) method multiplies the (x, y, z) coordinates of the input value with a scaling factor before returning the output value from the source module.

        Parameters:
        xScale - the scaling factor to apply to the x coordinate
      • getYScale

        public double getYScale()
        Get the scaling factor applied to the y coordinate of the input value.
        Returns:
        the scaling factor applied to the y coordinate
        See Also:
        DEFAULT_SCALE_POINT_Y
      • setYScale

        public void setYScale​(double yScale)
        Set the scaling factor to apply to the y coordinate of the input value.

        The getValue(double, double, double) method multiplies the (x, y, z) coordinates of the input value with a scaling factor before returning the output value from the source module.

        Parameters:
        yScale - the scaling factor to apply to the y coordinate
      • getZScale

        public double getZScale()
        Get the scaling factor applied to the z coordinate of the input value.
        Returns:
        the scaling factor applied to the z coordinate
        See Also:
        DEFAULT_SCALE_POINT_Z
      • setZScale

        public void setZScale​(double zScale)
        Set the scaling factor to apply to the z coordinate of the input value.

        The getValue(double, double, double) method multiplies the (x, y, z) coordinates of the input value with a scaling factor before returning the output value from the source module.

        Parameters:
        zScale - the scaling factor to apply to the z coordinate
      • setScale

        public void setScale​(double scale)
        Set the scaling factor to apply to the input value.

        The getValue(double, double, double) method multiplies the (x, y, z) coordinates of the input value with a scaling factor before returning the output value from the source module.

        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