24 double scale_factor,
double amp_scale,
25 int table_size,
unsigned long seed) {
26 _noises.reserve(num_levels);
28 for (
int i = 0; i < num_levels; ++i) {
32 seed =
noise.get_seed();
55 _noises = copy._noises;
64 _noises.push_back(Noise());
65 Noise &n = _noises.back();
83noise(
const LVecBase2d &value) {
87 for (ni = _noises.begin(); ni != _noises.end(); ++ni) {
88 result += (*ni)._noise(value) * (*ni)._amp;
This class provides an implementation of Perlin noise for 2 variables.
Implements a multi-layer PerlinNoise, with one or more high-frequency noise functions added to a lowe...
void add_level(const PerlinNoise2 &level, double amp=1.0)
Adds an arbitrary PerlinNoise2 object, and an associated amplitude, to the stack.
void clear()
Removes all levels from the stack.
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.
double noise(double x, double y)
Returns the noise function of the three inputs.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.