Package jme3utilities.math.noise
Class Noise
java.lang.Object
jme3utilities.math.noise.Noise
Pseudo-random and noise utility methods. Aside from test cases, all methods
should be public and static.
-
Method Summary
Modifier and TypeMethodDescriptionstatic floatfbmNoise(Noise2 noise2, float sampleX, float sampleY, int numOctaves, float fundamental, float gain, float lacunarity) Sample fractional Brownian motion (FBM) noise in 2 dimensions.static GeneratorAccess the shared generator.static floatObtain the next uniformly distributed, pseudo-random, single-precision value from the shared generator.static voidreseedGenerator(long newSeed) Re-seed the shared generator.
-
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 pointsampleY- the 2nd coordinate of the sample pointnumOctaves- 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)
-
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
-