15 #include "stackedPerlinNoise2.h" 29 double scale_factor,
double amp_scale,
30 int table_size,
unsigned long seed) {
31 _noises.reserve(num_levels);
33 for (
int i = 0; i < num_levels; ++i) {
66 _noises = copy._noises;
77 _noises.push_back(Noise());
78 Noise &n = _noises.back();
104 for (ni = _noises.begin(); ni != _noises.end(); ++ni) {
105 result += (*ni)._noise(value) * (*ni)._amp;
double noise(double x, double y)
Returns the noise function of the three inputs.
void add_level(const PerlinNoise2 &level, double amp=1.0)
Adds an arbitrary PerlinNoise2 object, and an associated amplitude, to the stack. ...
This is the base class for all two-component vectors and points.
This class provides an implementation of Perlin noise for 2 variables.
void clear()
Removes all levels from the stack.
Implements a multi-layer PerlinNoise, with one or more high-frequency noise functions added to a lowe...
StackedPerlinNoise2()
Creates a StackedPerlinNoise2 object with no levels.
void operator=(const StackedPerlinNoise2 ©)
Creates an exact duplicate of the existing StackedPerlinNoise2 object, including the random seed...
unsigned long get_seed()
Returns a unique seed value based on the seed value passed to this PerlinNoise object (and on its cur...