Implements a multi-layer PerlinNoise, with one or more high-frequency noise functions added to a lower-frequency base noise function. More...
#include "stackedPerlinNoise2.h"
Public Member Functions | |
StackedPerlinNoise2 () | |
Creates a StackedPerlinNoise2 object with no levels. More... | |
StackedPerlinNoise2 (double sx, double sy, int num_levels=2, double scale_factor=4.0f, double amp_scale=0.5f, int table_size=256, unsigned long seed=0) | |
Creates num_levels nested PerlinNoise2 objects. More... | |
StackedPerlinNoise2 (const StackedPerlinNoise2 ©) | |
Creates an exact duplicate of the existing StackedPerlinNoise2 object, including the random seed. More... | |
void | add_level (const PerlinNoise2 &level, double amp=1.0) |
Adds an arbitrary PerlinNoise2 object, and an associated amplitude, to the stack. More... | |
void | clear () |
Removes all levels from the stack. More... | |
double | noise (double x, double y) |
Returns the noise function of the three inputs. More... | |
float | noise (const LVecBase2f &value) |
Returns the noise function of the three inputs. More... | |
double | noise (const LVecBase2d &value) |
Returns the noise function of the three inputs. More... | |
double | operator() (double x, double y) |
Returns the noise function of the three inputs. More... | |
float | operator() (const LVecBase2f &value) |
Returns the noise function of the three inputs. More... | |
double | operator() (const LVecBase2d &value) |
Returns the noise function of the three inputs. More... | |
void | operator= (const StackedPerlinNoise2 ©) |
Creates an exact duplicate of the existing StackedPerlinNoise2 object, including the random seed. More... | |
Implements a multi-layer PerlinNoise, with one or more high-frequency noise functions added to a lower-frequency base noise function.
Definition at line 25 of file stackedPerlinNoise2.h.
|
inline |
Creates a StackedPerlinNoise2 object with no levels.
You should call add_level() to add each level by hand.
Definition at line 19 of file stackedPerlinNoise2.I.
|
explicit |
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).
Definition at line 23 of file stackedPerlinNoise2.cxx.
StackedPerlinNoise2::StackedPerlinNoise2 | ( | const StackedPerlinNoise2 & | copy | ) |
Creates an exact duplicate of the existing StackedPerlinNoise2 object, including the random seed.
Definition at line 44 of file stackedPerlinNoise2.cxx.
void StackedPerlinNoise2::add_level | ( | const PerlinNoise2 & | level, |
double | amp = 1.0 |
||
) |
Adds an arbitrary PerlinNoise2 object, and an associated amplitude, to the stack.
Definition at line 63 of file stackedPerlinNoise2.cxx.
void StackedPerlinNoise2::clear | ( | ) |
Removes all levels from the stack.
You must call add_level() again to restore them.
Definition at line 75 of file stackedPerlinNoise2.cxx.
|
inline |
Returns the noise function of the three inputs.
Definition at line 26 of file stackedPerlinNoise2.I.
Referenced by noise(), operator()(), and PNMImage::perlin_noise_fill().
|
inline |
Returns the noise function of the three inputs.
Definition at line 34 of file stackedPerlinNoise2.I.
References noise().
double StackedPerlinNoise2::noise | ( | const LVecBase2d & | value | ) |
Returns the noise function of the three inputs.
Definition at line 83 of file stackedPerlinNoise2.cxx.
|
inline |
Returns the noise function of the three inputs.
Definition at line 42 of file stackedPerlinNoise2.I.
References noise().
|
inline |
Returns the noise function of the three inputs.
Definition at line 50 of file stackedPerlinNoise2.I.
References noise().
|
inline |
Returns the noise function of the three inputs.
Definition at line 58 of file stackedPerlinNoise2.I.
References noise().
void StackedPerlinNoise2::operator= | ( | const StackedPerlinNoise2 & | copy | ) |
Creates an exact duplicate of the existing StackedPerlinNoise2 object, including the random seed.
Definition at line 54 of file stackedPerlinNoise2.cxx.