Panda3D
Public Member Functions | List of all members
StackedPerlinNoise2 Class Reference

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

Public Member Functions

 __init__ ()
 Creates a StackedPerlinNoise2 object with no levels. More...
 
 __init__ (const StackedPerlinNoise2 copy)
 Creates an exact duplicate of the existing StackedPerlinNoise2 object, including the random seed. More...
 
 __init__ (double sx, double sy, int num_levels, double scale_factor, double amp_scale, int table_size, unsigned long int seed)
 Creates num_levels nested PerlinNoise2 objects. More...
 
 addLevel (const PerlinNoise2 level, double amp)
 Adds an arbitrary PerlinNoise2 object, and an associated amplitude, to the stack. More...
 
 clear ()
 Removes all levels from the stack. More...
 
double noise (const LVecBase2d value)
 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 (double x, double y)
 Returns the noise function of the three inputs. More...
 
double operator() (const LVecBase2d value)
 
float operator() (const LVecBase2f value)
 
double operator() (double x, double y)
 
StackedPerlinNoise2 operator= (const StackedPerlinNoise2 copy)
 

Detailed Description

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

Member Function Documentation

◆ __init__() [1/3]

__init__ ( )

Creates a StackedPerlinNoise2 object with no levels.

You should call add_level() to add each level by hand.

◆ __init__() [2/3]

__init__ ( const StackedPerlinNoise2  copy)

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

◆ __init__() [3/3]

__init__ ( double  sx,
double  sy,
int  num_levels,
double  scale_factor,
double  amp_scale,
int  table_size,
unsigned long int  seed 
)

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).

◆ addLevel()

addLevel ( const PerlinNoise2  level,
double  amp 
)

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

◆ clear()

clear ( )

Removes all levels from the stack.

You must call add_level() again to restore them.

◆ noise() [1/3]

double noise ( const LVecBase2d  value)

Returns the noise function of the three inputs.

◆ noise() [2/3]

float noise ( const LVecBase2f  value)

Returns the noise function of the three inputs.

◆ noise() [3/3]

double noise ( double  x,
double  y 
)

Returns the noise function of the three inputs.

◆ operator()() [1/3]

double operator() ( const LVecBase2d  value)

◆ operator()() [2/3]

float operator() ( const LVecBase2f  value)

◆ operator()() [3/3]

double operator() ( double  x,
double  y 
)

◆ operator=()

StackedPerlinNoise2 operator= ( const StackedPerlinNoise2  copy)