Class Noise

java.lang.Object
jme3utilities.math.noise.Noise

public final class Noise extends Object
Pseudo-random and noise utility methods. Aside from test cases, all methods should be public and static.
  • Method Details

    • fbmNoise

      public static float fbmNoise(Noise2 noise2, float sampleX, float sampleY, int numOctaves, float fundamental, float gain, float lacunarity)
      Sample fractional Brownian motion (FBM) noise in 2 dimensions.
      Parameters:
      noise2 - base noise noise2 (not null)
      sampleX - the first coordinate of the sample point
      sampleY - the 2nd coordinate of the sample point
      numOctaves - number of noise components (>0)
      fundamental - frequency for the first component (>0)
      gain - amplitude ratio between octaves (>0, <1)
      lacunarity - frequency ratio between octaves (>1)
      Returns:
      noise value (range depends on parameters)
    • getSharedGenerator

      public static Generator getSharedGenerator()
      Access the shared generator.
      Returns:
      float value (≥0, <1)
    • nextFloat

      public static float nextFloat()
      Obtain the next uniformly distributed, pseudo-random, single-precision value from the shared generator.
      Returns:
      float value (≥0, <1)
      See Also:
      • FastMath.nextRandomFloat()
    • reseedGenerator

      public static void reseedGenerator(long newSeed)
      Re-seed the shared generator.
      Parameters:
      newSeed - seed for generating pseudo-random numbers