Interface DensityFunction

All Superinterfaces:
AutoKeyed, Keyed, Wrapper

@NullMarked @AsOf("2.4.0") public interface DensityFunction extends Wrapper, AutoKeyed
A density function. Either a reference to a registered one or an authored composition of other density functions.
Since:
2.4.0
  • Field Details

  • Method Details

    • add

      @AsOf("2.4.0") default DensityFunction add(DensityFunction other)
      Adds this density function to another density function.
      Parameters:
      other - the density function to add
      Returns:
      a new density function that is the sum of this density function and the other density function
      Since:
      2.4.0
    • mul

      @AsOf("2.4.0") default DensityFunction mul(DensityFunction other)
      Multiplies this density function by another density function.
      Parameters:
      other - the density function to multiply by
      Returns:
      a new density function that is the product of this density function and the other density function
      Since:
      2.4.0
    • min

      @AsOf("2.4.0") default DensityFunction min(DensityFunction other)
      Returns the minimum of this density function and another density function.
      Parameters:
      other - the density function to compare with
      Returns:
      a new density function that is the minimum of this density function and the other density function
      Since:
      2.4.0
    • max

      @AsOf("2.4.0") default DensityFunction max(DensityFunction other)
      Returns the maximum of this density function and another density function.
      Parameters:
      other - the density function to compare with
      Returns:
      a new density function that is the maximum of this density function and the other density function
      Since:
      2.4.0
    • shiftedNoise2dX

      @AsOf("2.4.0") default DensityFunction shiftedNoise2dX(DensityFunction shiftZ, double xzScale, ResourceKey noiseParameters)
      Returns the absolute value of this density function.
      Parameters:
      shiftZ - 2D noise function to shift the Z axis of
      xzScale - scale factor for the X and Z axes
      noiseParameters - the noise parameters to use for the noise function
      Returns:
      a new density function that is the absolute value of this density function
      Since:
      2.4.0
    • shiftedNoise2dZ

      @AsOf("2.4.0") default DensityFunction shiftedNoise2dZ(DensityFunction shiftX, double xzScale, ResourceKey noiseParameters)
      Returns the absolute value of this density function.
      Parameters:
      shiftX - 2D noise function to shift the X axis of
      xzScale - scale factor for the X and Z axes
      noiseParameters - the noise parameters to use for the noise function
      Returns:
      a new density function that is the absolute value of this density function
      Since:
      2.4.0
    • rangeChoice

      @AsOf("2.4.0") default DensityFunction rangeChoice(double minInclusive, double maxExclusive, DensityFunction whenInRange, DensityFunction whenOutOfRange)
      Returns the absolute value of this density function.
      Parameters:
      minInclusive - the minimum value of the input function
      maxExclusive - the maximum value of the input function
      whenInRange - the density function to return if the input function is within the range
      whenOutOfRange - the density function to return if the input function is outside the range
      Returns:
      a new density function that is the absolute value of this density function
      Since:
      2.4.0
    • blendDensity

      @AsOf("2.4.0") default DensityFunction blendDensity()
      Returns the absolute value of this density function.
      Returns:
      a new density function that is the absolute value of this density function
      Since:
      2.4.0
    • findTopSurface

      @AsOf("2.4.0") default DensityFunction findTopSurface(DensityFunction upperBound, int lowerBound, int cellHeight)
      Returns the absolute value of this density function.
      Parameters:
      upperBound - the upper bound of the surface
      lowerBound - the lower bound of the surface
      cellHeight - the height of the cell to find the surface in
      Returns:
      a new density function that is the absolute value of this density function
      Since:
      2.4.0
    • reference

      @AsOf("2.4.0") static DensityFunction reference(ResourceKey key)
      Creates a reference to a registered density function.
      Parameters:
      key - the key of an entry in the density-function registry
      Returns:
      a reference to that density function
      Since:
      2.4.0
    • constant

      @AsOf("2.4.0") static DensityFunction constant(double value)
      Creates a constant density function.
      Parameters:
      value - the constant value of the function
      Returns:
      a constant density function
      Since:
      2.4.0
    • zero

      @AsOf("2.4.0") static DensityFunction zero()
      Creates a density function that always returns 0.
      Returns:
      a density function that always returns 0
      Since:
      2.4.0
    • add

      @AsOf("2.4.0") static DensityFunction add(DensityFunction first, DensityFunction second)
      Creates a new density function by adding two other density functions together.
      Parameters:
      first - the first density function
      second - the second density function
      Returns:
      a new density function that is the sum of the two input functions
      Since:
      2.4.0
    • mul

      @AsOf("2.4.0") static DensityFunction mul(DensityFunction first, DensityFunction second)
      Creates a new density function by multiplying two other density functions together.
      Parameters:
      first - the first density function
      second - the second density function
      Returns:
      a new density function that is the product of the two input functions
      Since:
      2.4.0
    • min

      @AsOf("2.4.0") static DensityFunction min(DensityFunction first, DensityFunction second)
      Creates a new density function that is the minimum of two other density functions.
      Parameters:
      first - the first density function
      second - the second density function
      Returns:
      a new density function that is the minimum of the two input functions
      Since:
      2.4.0
    • max

      @AsOf("2.4.0") static DensityFunction max(DensityFunction first, DensityFunction second)
      Creates a new density function that is the maximum of two other density functions.
      Parameters:
      first - the first density function
      second - the second density function
      Returns:
      a new density function that is the maximum of the two input functions
      Since:
      2.4.0
    • noise

      @AsOf("2.4.0") static DensityFunction noise(ResourceKey noiseParameters)
      Creates a new density function that is the absolute value of the input function.
      Parameters:
      noiseParameters - the noise parameters to use for the noise function
      Returns:
      a new density function that is the absolute value of the input function
      Since:
      2.4.0
    • noise

      @AsOf("2.4.0") static DensityFunction noise(ResourceKey noiseParameters, double xzScale, double yScale)
      Creates a new density function that is the absolute value of the input function.
      Parameters:
      noiseParameters - the noise parameters to use for the noise function
      xzScale - the scale factor for the x and z axes
      yScale - the scale factor for the y-axis
      Returns:
      a new density function that is the absolute value of the input function
      Since:
      2.4.0
    • mappedNoise

      @AsOf("2.4.0") static DensityFunction mappedNoise(ResourceKey noiseParameters, double minTarget, double maxTarget)
      Creates a new density function that is the absolute value of the input function.
      Parameters:
      noiseParameters - the noise parameters to use for the noise function
      minTarget - the minimum value of the output function
      maxTarget - the maximum value of the output function
      Returns:
      a new density function that is the absolute value of the input function
      Since:
      2.4.0
    • mappedNoise

      @AsOf("2.4.0") static DensityFunction mappedNoise(ResourceKey noiseParameters, double xzScale, double yScale, double minTarget, double maxTarget)
      Creates a new density function that is the absolute value of the input function.
      Parameters:
      noiseParameters - the noise parameters to use for the noise function
      xzScale - the scale factor for the x and z axes
      yScale - the scale factor for the y-axis
      minTarget - the minimum value of the output function
      maxTarget - the maximum value of the output function
      Returns:
      a new density function that is the absolute value of the input function
      Since:
      2.4.0
    • shift

      @AsOf("2.4.0") static DensityFunction shift(ResourceKey noiseParameters)
      Creates a new density function that is the absolute value of the input function.
      Parameters:
      noiseParameters - the noise parameters to use for the noise function
      Returns:
      a new density function that is the absolute value of the input function
      Since:
      2.4.0
    • shiftA

      @AsOf("2.4.0") static DensityFunction shiftA(ResourceKey noiseParameters)
      Creates a new density function that is the absolute value of the input function.
      Parameters:
      noiseParameters - the noise parameters to use for the noise function
      Returns:
      a new density function that is the absolute value of the input function
      Since:
      2.4.0
    • shiftB

      @AsOf("2.4.0") static DensityFunction shiftB(ResourceKey noiseParameters)
      Creates a new density function that is the absolute value of the input function.
      Parameters:
      noiseParameters - the noise parameters to use for the noise function
      Returns:
      a new density function that is the absolute value of the input function
      Since:
      2.4.0
    • shiftedNoise2d

      @AsOf("2.4.0") static DensityFunction shiftedNoise2d(DensityFunction shiftX, DensityFunction shiftZ, double xzScale, ResourceKey noiseParameters)
      Creates a new density function that is the absolute value of the input function.
      Parameters:
      shiftX - 2D noise function to shift the X axis of
      shiftZ - 2D noise function to shift the Z axis of
      xzScale - scale factor for the X and Z axes
      noiseParameters - the noise parameters to use for the noise function
      Returns:
      a new density function that is the absolute value of the input function
      Since:
      2.4.0
    • rangeChoice

      @AsOf("2.4.0") static DensityFunction rangeChoice(DensityFunction input, double minInclusive, double maxExclusive, DensityFunction whenInRange, DensityFunction whenOutOfRange)
      Creates a new density function that is the absolute value of the input function.
      Parameters:
      input - the density function to choose from
      minInclusive - the minimum value of the input function
      maxExclusive - the maximum value of the input function
      whenInRange - the density function to return if the input function is within the range
      whenOutOfRange - the density function to return if the input function is outside the range
      Returns:
      a new density function that is the absolute value of the input function
      Since:
      2.4.0
    • yClampedGradient

      @AsOf("2.4.0") static DensityFunction yClampedGradient(int fromY, int toY, double fromValue, double toValue)
      Creates a new density function that is the absolute value of the input function.
      Parameters:
      fromY - the minimum Y value of the gradient
      toY - the maximum Y value of the gradient
      fromValue - the value of the gradient at the minimum Y value
      toValue - the value of the gradient at the maximum Y value
      Returns:
      a new density function that is the absolute value of the input function
      Since:
      2.4.0
    • endIslands

      @AsOf("2.4.0") static DensityFunction endIslands(long seed)
      Creates a new density function that is the absolute value of the input function.
      Parameters:
      seed - the seed to use for the end-islands function
      Returns:
      a new density function that is the absolute value of the input function
      Since:
      2.4.0
    • blendDensity

      @AsOf("2.4.0") static DensityFunction blendDensity(DensityFunction input)
      Creates a new density function that is the absolute value of the input function.
      Parameters:
      input - the density function to blend
      Returns:
      a new density function that is the absolute value of the input function
      Since:
      2.4.0
    • blendAlpha

      @AsOf("2.4.0") static DensityFunction blendAlpha()
      Creates a new density function that is the absolute value of the input function.
      Returns:
      a new density function that is the absolute value of the input function
      Since:
      2.4.0
    • blendOffset

      @AsOf("2.4.0") static DensityFunction blendOffset()
      Creates a new density function that is the absolute value of the input function.
      Returns:
      a new density function that is the absolute value of the input function
      Since:
      2.4.0
    • findTopSurface

      @AsOf("2.4.0") static DensityFunction findTopSurface(DensityFunction density, DensityFunction upperBound, int lowerBound, int cellHeight)
      Creates a new density function that is the absolute value of the input function.
      Parameters:
      density - the density function to find the top surface of
      upperBound - the upper bound of the surface
      lowerBound - the lower bound of the surface
      cellHeight - the height of the cell to find the surface in
      Returns:
      a new density function that is the absolute value of the input function
      Since:
      2.4.0
    • clamp

      @AsOf("2.4.0") default DensityFunction clamp(double min, double max)
      Creates a new density function that is the absolute value of the input function.
      Parameters:
      min - the minimum value of the function
      max - the maximum value of the function
      Returns:
      a new density function that is the absolute value of the input function
      Since:
      2.4.0
    • abs

      @AsOf("2.4.0") default DensityFunction abs()
      Creates a new density function that is the absolute value of the input function.
      Returns:
      a new density function that is the absolute value of the input function
      Since:
      2.4.0
    • square

      @AsOf("2.4.0") default DensityFunction square()
      Creates a new density function that is the absolute value of the input function.
      Returns:
      a new density function that is the absolute value of the input function
      Since:
      2.4.0
    • cube

      @AsOf("2.4.0") default DensityFunction cube()
      Creates a new density function that is the absolute value of the input function.
      Returns:
      a new density function that is the absolute value of the input function
      Since:
      2.4.0
    • halfNegative

      @AsOf("2.4.0") default DensityFunction halfNegative()
      Creates a new density function that is the absolute value of the input function.
      Returns:
      a new density function that is the absolute value of the input function
      Since:
      2.4.0
    • quarterNegative

      @AsOf("2.4.0") default DensityFunction quarterNegative()
      Creates a new density function that is the absolute value of the input function.
      Returns:
      a new density function that is the absolute value of the input function
      Since:
      2.4.0
    • invert

      @AsOf("2.4.0") default DensityFunction invert()
      Creates a new density function that is the absolute value of the input function.
      Returns:
      a new density function that is the absolute value of the input function
      Since:
      2.4.0
    • squeeze

      @AsOf("2.4.0") default DensityFunction squeeze()
      Creates a new density function that is the absolute value of the input function.
      Returns:
      a new density function that is the absolute value of the input function
      Since:
      2.4.0
    • interpolated

      @AsOf("2.4.0") default DensityFunction interpolated()
      Creates a new density function that is the absolute value of the input function.
      Returns:
      a new density function that is the absolute value of the input function
      Since:
      2.4.0
    • flatCache

      @AsOf("2.4.0") default DensityFunction flatCache()
      Creates a new density function that is the absolute value of the input function.
      Returns:
      a new density function that is the absolute value of the input function
      Since:
      2.4.0
    • cache2d

      @AsOf("2.4.0") default DensityFunction cache2d()
      Creates a new density function that is the absolute value of the input function.
      Returns:
      a new density function that is the absolute value of the input function
      Since:
      2.4.0
    • cacheOnce

      @AsOf("2.4.0") default DensityFunction cacheOnce()
      Creates a new density function that is the absolute value of the input function.
      Returns:
      a new density function that is the absolute value of the input function
      Since:
      2.4.0
    • cacheAllInCell

      @AsOf("2.4.0") default DensityFunction cacheAllInCell()
      Creates a new density function that is the absolute value of the input function.
      Returns:
      a new density function that is the absolute value of the input function
      Since:
      2.4.0