Class Noise

java.lang.Object
net.dermetfan.utils.math.Noise

public abstract class Noise extends Object
provides noise algorithms
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static float[][]
    diamondSquare(int n, float smoothness, float range, boolean wrapX, boolean wrapY, boolean initializeRandomly, float init, int scaleX, int scaleY)
     
    static float[][]
    diamondSquare(int n, float smoothness, float range, boolean wrapX, boolean wrapY, float init, int scaleX, int scaleY)
     
    static float[][]
    diamondSquare(int n, float smoothness, float range, boolean wrapX, boolean wrapY, int scaleX, int scaleY)
     
    static float[][]
    diamondSquare(int n, float smoothness, float range, boolean wrapX, boolean wrapY, Function<Pair<Float,Float>,Float> init, int scaleX, int scaleY)
     
    static Random
     
    static long
     
    static boolean
     
    static float[]
    midpointDisplacement(float[] values, float range, float smoothness)
    randomizes a given float array using the midpoint-displacement algorithm
    static float[][]
    midpointDisplacement(int n, float smoothness, float range, boolean initializeRandomly, float init, int scaleX, int scaleY)
     
    static float[][]
    midpointDisplacement(int n, float smoothness, float range, float init, int scaleX, int scaleY)
     
    static float[][]
    midpointDisplacement(int n, float smoothness, float range, int scaleX, int scaleY)
     
    static float[][]
    midpointDisplacement(int n, float smoothness, float range, Function<Pair<Float,Float>,Float> init, int scaleX, int scaleY)
     
    static float
    random(float start, float end)
     
    static void
    setSeed(long seed)
     
    static void
    setSeedEnabled(boolean seedEnabled)
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • Noise

      public Noise()
  • Method Details

    • midpointDisplacement

      public static float[] midpointDisplacement(float[] values, float range, float smoothness)
      randomizes a given float array using the midpoint-displacement algorithm
      Parameters:
      values - the float array to randomize
      range - the range used for random values
      smoothness - the smoothness of the transitions
      Returns:
      the randomized float array
    • midpointDisplacement

      public static float[][] midpointDisplacement(int n, float smoothness, float range, int scaleX, int scaleY)
      See Also:
      • midpointDisplacement(int, float, float, boolean, net.dermetfan.utils.Function, int, int)
    • midpointDisplacement

      public static float[][] midpointDisplacement(int n, float smoothness, float range, Function<Pair<Float,Float>,Float> init, int scaleX, int scaleY)
      See Also:
      • midpointDisplacement(int, float, float, boolean, net.dermetfan.utils.Function, int, int)
    • midpointDisplacement

      public static float[][] midpointDisplacement(int n, float smoothness, float range, float init, int scaleX, int scaleY)
      See Also:
    • midpointDisplacement

      public static float[][] midpointDisplacement(int n, float smoothness, float range, boolean initializeRandomly, float init, int scaleX, int scaleY)
      See Also:
      • midpointDisplacement(int, float, float, boolean, net.dermetfan.utils.Function, int, int)
    • diamondSquare

      public static float[][] diamondSquare(int n, float smoothness, float range, boolean wrapX, boolean wrapY, Function<Pair<Float,Float>,Float> init, int scaleX, int scaleY)
      See Also:
      • diamondSquare(int, float, float, boolean, boolean, boolean, net.dermetfan.utils.Function, int, int)
    • diamondSquare

      public static float[][] diamondSquare(int n, float smoothness, float range, boolean wrapX, boolean wrapY, int scaleX, int scaleY)
      See Also:
    • diamondSquare

      public static float[][] diamondSquare(int n, float smoothness, float range, boolean wrapX, boolean wrapY, float init, int scaleX, int scaleY)
      See Also:
    • diamondSquare

      public static float[][] diamondSquare(int n, float smoothness, float range, boolean wrapX, boolean wrapY, boolean initializeRandomly, float init, int scaleX, int scaleY)
      Parameters:
      init - the value to initialize every coordinate with
      See Also:
      • diamondSquare(int, float, float, boolean, boolean, boolean, net.dermetfan.utils.Function, int, int)
    • random

      public static float random(float start, float end)
      Returns:
      a random value between start (inclusive) and end (exclusive)
    • setSeedEnabled

      public static void setSeedEnabled(boolean seedEnabled)
      Parameters:
      seedEnabled - if seed should be used
    • isSeedEnabled

      public static boolean isSeedEnabled()
      Returns:
      the seedEnabled
    • getSeed

      public static long getSeed()
      Returns:
      the seed
    • setSeed

      public static void setSeed(long seed)
      Parameters:
      seed - the seed to set
    • getRandom

      public static Random getRandom()
      Returns:
      the random