Class PerlinNoise

java.lang.Object
org.pepsoft.util.PerlinNoise
All Implemented Interfaces:
Serializable, Cloneable

public final class PerlinNoise extends Object implements Serializable, Cloneable
See Also:
  • Constructor Details

    • PerlinNoise

      public PerlinNoise(long seed)
  • Method Details

    • getSeed

      public long getSeed()
    • setSeed

      public void setSeed(long seed)
    • getPerlinNoise

      public float getPerlinNoise(double x)
      Generates one dimensional noise. The input value is normalised to be between 0 (inclusive) and 256 (exclusive), so the input should be constrained to be between those values for best results (otherwise the pattern will start to repeat).
      Parameters:
      x - The point for which to determine the noise value.
      Returns:
      A noise value between -0.5 and 0.5.
    • getPerlinNoise

      public float getPerlinNoise(double x, double y)
      Generates two dimensional noise. The input values are normalised to be between 0 (inclusive) and 256 (exclusive), so the input should be constrained to be between those values for best results (otherwise the pattern will start to repeat).
      Parameters:
      x - The X coordinate of the point for which to determine the noise value.
      y - The Y coordinate of the point for which to determine the noise value.
      Returns:
      A noise value between -0.5 and 0.5.
    • getPerlinNoise

      public float getPerlinNoise(double x, double y, double z)
      Generates three dimensional noise. The input values are normalised to be between 0 (inclusive) and 256 (exclusive), so the input should be constrained to be between those values for best results (otherwise the pattern will start to repeat).
      Parameters:
      x - The X coordinate of the point for which to determine the noise value.
      y - The Y coordinate of the point for which to determine the noise value.
      z - The Z coordinate of the point for which to determine the noise value.
      Returns:
      A noise value between -0.5 and 0.5.
    • clone

      public Object clone()
      Overrides:
      clone in class Object
    • getLevelForPromillage

      public static float getLevelForPromillage(int promillage)
    • getLevelForPromillage

      public static float getLevelForPromillage(float promillage)