Panda3D
|
This class provides an implementation of Perlin noise for 2 variables. More...
#include <pandadoc.hpp>
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... | |
![]() | |
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... | |
This class provides an implementation of Perlin noise for 2 variables.
This code is loosely based on the reference implementation at https://mrl.nyu.edu/~perlin/noise/ .
__init__ | ( | ) |
Randomizes the tables to make a unique noise function.
Uses a default scale (noise frequency), table size, and seed.
__init__ | ( | const PerlinNoise2 | copy | ) |
Makes an exact copy of the existing PerlinNoise object, including its random seed.
__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.
double noise | ( | const LVecBase2d | value | ) |
Returns the noise function of the three inputs.
float noise | ( | const LVecBase2f | value | ) |
Returns the noise function of the three inputs.
double noise | ( | double | x, |
double | y | ||
) |
Returns the noise function of the three inputs.
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.
setScale | ( | const LVecBase2f | scale | ) |
Changes the scale (frequency) of the noise.
setScale | ( | double | scale | ) |
Changes the scale (frequency) of the noise.
setScale | ( | double | sx, |
double | sy | ||
) |
Changes the scale (frequency) of the noise.