public class WhiteNoise extends java.lang.Object implements Noise.Noise1D, Noise.Noise2D, Noise.Noise3D, Noise.Noise4D, Noise.Noise6D
SeededNoise
. It is not actually random, and the value is always determined by
the exact double positions (and possibly a long seed) given to it. Even a slight change should drastically alter the
returned value, though below some very small epsilon the results might not be different between two very close points
in space. The output should look like "TV static" if rendered as grayscale pixels.
CrossHash.Wisp.hash64(double[])
, treating doubles as ints
by using NumberTools.doubleToMixedIntBits(double)
, which XORs the bottom and top halves of the long bits of
each double. Finishes by passing the top 52 bits as a significand to NumberTools.longBitsToDouble(long)
,
using an exponent that allows this to produce numbers between -1.0 and 1.0. Has special treatment for the seed when
present (since it is a long).
hash(double...)
.Modifier and Type | Field and Description |
---|---|
static WhiteNoise |
instance |
Constructor and Description |
---|
WhiteNoise() |
Modifier and Type | Method and Description |
---|---|
double |
getNoise(double x) |
double |
getNoise(double x,
double y) |
double |
getNoise(double x,
double y,
double z) |
double |
getNoise(double x,
double y,
double z,
double w) |
double |
getNoise(double x,
double y,
double z,
double w,
double u,
double v) |
double |
getNoiseWithSeed(double x,
double y,
double z,
double w,
double u,
double v,
long seed) |
double |
getNoiseWithSeed(double x,
double y,
double z,
double w,
long seed) |
double |
getNoiseWithSeed(double x,
double y,
double z,
long seed) |
double |
getNoiseWithSeed(double x,
double y,
long seed) |
double |
getNoiseWithSeed(double x,
long seed) |
static double |
hash(double... data)
Hashes the input double array or vararg and produces a double with unpredictable value, between -1.0 inclusive
and 1.0 exclusive.
|
public static final WhiteNoise instance
public double getNoise(double x)
getNoise
in interface Noise.Noise1D
public double getNoiseWithSeed(double x, long seed)
getNoiseWithSeed
in interface Noise.Noise1D
public double getNoise(double x, double y)
getNoise
in interface Noise.Noise2D
public double getNoiseWithSeed(double x, double y, long seed)
getNoiseWithSeed
in interface Noise.Noise2D
public double getNoise(double x, double y, double z)
getNoise
in interface Noise.Noise3D
public double getNoiseWithSeed(double x, double y, double z, long seed)
getNoiseWithSeed
in interface Noise.Noise3D
public double getNoise(double x, double y, double z, double w)
getNoise
in interface Noise.Noise4D
public double getNoiseWithSeed(double x, double y, double z, double w, long seed)
getNoiseWithSeed
in interface Noise.Noise4D
public double getNoise(double x, double y, double z, double w, double u, double v)
getNoise
in interface Noise.Noise6D
public double getNoiseWithSeed(double x, double y, double z, double w, double u, double v, long seed)
getNoiseWithSeed
in interface Noise.Noise6D
public static double hash(double... data)
data
- an array or vararg of double items; should not include NaN or infinite values but has no other limitsCopyright © Eben Howard 2012–2022. All rights reserved.