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();
56 _noises = copy._noises;
65 _noises.push_back(Noise());
66 Noise &n = _noises.back();
84 noise(
const LVecBase3d &value) {
88 for (ni = _noises.begin(); ni != _noises.end(); ++ni) {
89 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.
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.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.