StackedPerlinNoise2

class StackedPerlinNoise2

Implements a multi-layer PerlinNoise, with one or more high-frequency noise functions added to a lower-frequency base noise function.

Inheritance diagram

Inheritance diagram of StackedPerlinNoise2

StackedPerlinNoise2(void)
explicit StackedPerlinNoise2(double sx, double sy, int num_levels = 2, double scale_factor = 4.0, double amp_scale = 0.5, int table_size = 256, unsigned long int seed = 0)
StackedPerlinNoise2(StackedPerlinNoise2 const &copy)

Creates a StackedPerlinNoise2 object with no levels. You should call add_level() to add each level by hand.

Creates num_levels nested PerlinNoise2 objects. Each stacked Perlin object will have a scale of 1 scale_factor times the previous object (so that it is higher-frequency, if scale_factor > 1), and an amplitude of amp_scale times the previous object (so that it is less important, if amp_scale < 1).

Creates an exact duplicate of the existing StackedPerlinNoise2 object, including the random seed.

void add_level(PerlinNoise2 const &level, double amp = 1.0)

Adds an arbitrary PerlinNoise2 object, and an associated amplitude, to the stack.

void clear(void)

Removes all levels from the stack. You must call add_level() again to restore them.

double noise(double x, double y)
float noise(LVecBase2f const &value)
double noise(LVecBase2d const &value)

Returns the noise function of the three inputs.