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

This class provides an implementation of Perlin noise for 2 variables. More...

Inheritance diagram for PerlinNoise2:
PerlinNoise

Public Member Functions

 __init__ ()
 Randomizes the tables to make a unique noise function. More...
 
 __init__ (const PerlinNoise2 copy)
 Makes an exact copy of the existing PerlinNoise object, including its random seed. More...
 
 __init__ (double sx, double sy, int table_size, unsigned long int seed)
 Randomizes the tables to make a unique noise function. 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)
 
PerlinNoise2 operator= (const PerlinNoise2 copy)
 
 setScale (const LVecBase2d scale)
 Changes the scale (frequency) of the noise. More...
 
 setScale (const LVecBase2f scale)
 Changes the scale (frequency) of the noise. More...
 
 setScale (double scale)
 Changes the scale (frequency) of the noise. More...
 
 setScale (double sx, double sy)
 Changes the scale (frequency) of the noise. More...
 
- Public Member Functions inherited from PerlinNoise
unsigned long int getSeed ()
 Returns a unique seed value based on the seed value passed to this PerlinNoise object (and on its current state). More...
 

Detailed Description

This class provides an implementation of Perlin noise for 2 variables.

This code is loosely based on the reference implementation at http://mrl.nyu.edu/~perlin/noise/ .

Member Function Documentation

◆ __init__() [1/3]

__init__ ( )

Randomizes the tables to make a unique noise function.

Uses a default scale (noise frequency), table size, and seed.

◆ __init__() [2/3]

__init__ ( const PerlinNoise2  copy)

Makes an exact copy of the existing PerlinNoise object, including its random seed.

◆ __init__() [3/3]

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

Randomizes the tables to make a unique noise function.

If seed is nonzero, it is used to define the tables; if it is zero a random seed is generated.

◆ 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=()

PerlinNoise2 operator= ( const PerlinNoise2  copy)

◆ setScale() [1/4]

setScale ( const LVecBase2d  scale)

Changes the scale (frequency) of the noise.

◆ setScale() [2/4]

setScale ( const LVecBase2f  scale)

Changes the scale (frequency) of the noise.

◆ setScale() [3/4]

setScale ( double  scale)

Changes the scale (frequency) of the noise.

◆ setScale() [4/4]

setScale ( double  sx,
double  sy 
)

Changes the scale (frequency) of the noise.