15 #include "stackedPerlinNoise3.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) {
67 _noises = copy._noises;
78 _noises.push_back(Noise());
79 Noise &n = _noises.back();
105 for (ni = _noises.begin(); ni != _noises.end(); ++ni) {
106 result += (*ni)._noise(value) * (*ni)._amp;
void add_level(const PerlinNoise3 &level, double amp=1.0)
Adds an arbitrary PerlinNoise3 object, and an associated amplitude, to the stack. ...
This class provides an implementation of Perlin noise for 3 variables.
StackedPerlinNoise3()
Creates a StackedPerlinNoise3 object with no levels.
This is the base class for all three-component vectors and points.
unsigned long get_seed()
Returns a unique seed value based on the seed value passed to this PerlinNoise object (and on its cur...
double noise(double x, double y, double z)
Returns the noise function of the three inputs.
Implements a multi-layer PerlinNoise, with one or more high-frequency noise functions added to a lowe...
void operator=(const StackedPerlinNoise3 ©)
Creates an exact duplicate of the existing StackedPerlinNoise3 object, including the random seed...
void clear()
Removes all levels from the stack.