Panda3D
Classes | Public Member Functions | List of all members
StackedPerlinNoise3 Class Reference

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

#include "stackedPerlinNoise3.h"

Public Member Functions

 StackedPerlinNoise3 ()
 Creates a StackedPerlinNoise3 object with no levels. More...
 
 StackedPerlinNoise3 (double sx, double sy, double sz, int num_levels=3, double scale_factor=4.0f, double amp_scale=0.5f, int table_size=256, unsigned long seed=0)
 Creates num_levels nested PerlinNoise3 objects. More...
 
 StackedPerlinNoise3 (const StackedPerlinNoise3 &copy)
 Creates an exact duplicate of the existing StackedPerlinNoise3 object, including the random seed. More...
 
void add_level (const PerlinNoise3 &level, double amp=1.0)
 Adds an arbitrary PerlinNoise3 object, and an associated amplitude, to the stack. More...
 
void clear ()
 Removes all levels from the stack. More...
 
double noise (double x, double y, double z)
 Returns the noise function of the three inputs. More...
 
float noise (const LVecBase3f &value)
 Returns the noise function of the three inputs. More...
 
double noise (const LVecBase3d &value)
 Returns the noise function of the three inputs. More...
 
double operator() (double x, double y, double z)
 Returns the noise function of the three inputs. More...
 
float operator() (const LVecBase3f &value)
 Returns the noise function of the three inputs. More...
 
double operator() (const LVecBase3d &value)
 Returns the noise function of the three inputs. More...
 
void operator= (const StackedPerlinNoise3 &copy)
 Creates an exact duplicate of the existing StackedPerlinNoise3 object, including the random seed. More...
 

Detailed Description

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 stackedPerlinNoise3.h.

Constructor & Destructor Documentation

◆ StackedPerlinNoise3() [1/3]

StackedPerlinNoise3::StackedPerlinNoise3 ( )
inline

Creates a StackedPerlinNoise3 object with no levels.

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

Definition at line 19 of file stackedPerlinNoise3.I.

◆ StackedPerlinNoise3() [2/3]

StackedPerlinNoise3::StackedPerlinNoise3 ( double  sx,
double  sy,
double  sz,
int  num_levels = 3,
double  scale_factor = 4.0f,
double  amp_scale = 0.5f,
int  table_size = 256,
unsigned long  seed = 0 
)
explicit

Creates num_levels nested PerlinNoise3 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 stackedPerlinNoise3.cxx.

◆ StackedPerlinNoise3() [3/3]

StackedPerlinNoise3::StackedPerlinNoise3 ( const StackedPerlinNoise3 copy)

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

Definition at line 45 of file stackedPerlinNoise3.cxx.

Member Function Documentation

◆ add_level()

void StackedPerlinNoise3::add_level ( const PerlinNoise3 level,
double  amp = 1.0 
)

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

Definition at line 64 of file stackedPerlinNoise3.cxx.

◆ clear()

void StackedPerlinNoise3::clear ( )

Removes all levels from the stack.

You must call add_level() again to restore them.

Definition at line 76 of file stackedPerlinNoise3.cxx.

◆ noise() [1/3]

double StackedPerlinNoise3::noise ( double  x,
double  y,
double  z 
)
inline

Returns the noise function of the three inputs.

Definition at line 26 of file stackedPerlinNoise3.I.

Referenced by noise(), and operator()().

◆ noise() [2/3]

float StackedPerlinNoise3::noise ( const LVecBase3f &  value)
inline

Returns the noise function of the three inputs.

Definition at line 34 of file stackedPerlinNoise3.I.

References noise().

◆ noise() [3/3]

double StackedPerlinNoise3::noise ( const LVecBase3d &  value)

Returns the noise function of the three inputs.

Definition at line 84 of file stackedPerlinNoise3.cxx.

◆ operator()() [1/3]

double StackedPerlinNoise3::operator() ( double  x,
double  y,
double  z 
)
inline

Returns the noise function of the three inputs.

Definition at line 42 of file stackedPerlinNoise3.I.

References noise().

◆ operator()() [2/3]

float StackedPerlinNoise3::operator() ( const LVecBase3f &  value)
inline

Returns the noise function of the three inputs.

Definition at line 50 of file stackedPerlinNoise3.I.

References noise().

◆ operator()() [3/3]

double StackedPerlinNoise3::operator() ( const LVecBase3d &  value)
inline

Returns the noise function of the three inputs.

Definition at line 58 of file stackedPerlinNoise3.I.

References noise().

◆ operator=()

void StackedPerlinNoise3::operator= ( const StackedPerlinNoise3 copy)

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

Definition at line 55 of file stackedPerlinNoise3.cxx.


The documentation for this class was generated from the following files: