Panda3D
|
This class provides an implementation of Perlin noise for 2 variables. More...
#include "perlinNoise2.h"
Public Member Functions | |
PerlinNoise2 () | |
Randomizes the tables to make a unique noise function. | |
PerlinNoise2 (const PerlinNoise2 ©) | |
Makes an exact copy of the existing PerlinNoise object, including its random seed. | |
PerlinNoise2 (double sx, double sy, int table_size=256, unsigned long seed=0) | |
Randomizes the tables to make a unique noise function. | |
double | noise (const LVecBase2d &value) const |
Returns the noise function of the three inputs. | |
float | noise (const LVecBase2f &value) const |
Returns the noise function of the three inputs. | |
double | noise (double x, double y) const |
Returns the noise function of the three inputs. | |
double | operator() (const LVecBase2d &value) const |
Returns the noise function of the two inputs. | |
float | operator() (const LVecBase2f &value) const |
Returns the noise function of the two inputs. | |
double | operator() (double x, double y) const |
Returns the noise function of the two inputs. | |
void | operator= (const PerlinNoise2 ©) |
Makes an exact copy of the existing PerlinNoise object, including its random seed. | |
void | set_scale (const LVecBase2d &scale) |
Changes the scale (frequency) of the noise. | |
void | set_scale (const LVecBase2f &scale) |
Changes the scale (frequency) of the noise. | |
void | set_scale (double scale) |
Changes the scale (frequency) of the noise. | |
void | set_scale (double sx, double sy) |
Changes the scale (frequency) of the noise. | |
![]() | |
unsigned long | get_seed () |
Returns a unique seed value based on the seed value passed to this PerlinNoise object (and on its current state). | |
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/ .
Definition at line 25 of file perlinNoise2.h.
|
inline |
Randomizes the tables to make a unique noise function.
Uses a default scale (noise frequency), table size, and seed.
Definition at line 18 of file perlinNoise2.I.
|
inlineexplicit |
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.
Definition at line 32 of file perlinNoise2.I.
References set_scale().
|
inline |
Makes an exact copy of the existing PerlinNoise object, including its random seed.
Definition at line 45 of file perlinNoise2.I.
double PerlinNoise2::noise | ( | const LVecBase2d & | value | ) | const |
Returns the noise function of the three inputs.
Definition at line 20 of file perlinNoise2.cxx.
|
inline |
Returns the noise function of the three inputs.
Definition at line 107 of file perlinNoise2.I.
References noise().
|
inline |
Returns the noise function of the three inputs.
Definition at line 99 of file perlinNoise2.I.
References noise().
Referenced by noise(), noise(), operator()(), operator()(), operator()(), and PNMImage::perlin_noise_fill().
|
inline |
Returns the noise function of the two inputs.
Definition at line 131 of file perlinNoise2.I.
References noise().
|
inline |
Returns the noise function of the two inputs.
Definition at line 123 of file perlinNoise2.I.
References noise().
|
inline |
Returns the noise function of the two inputs.
Definition at line 115 of file perlinNoise2.I.
References noise().
|
inline |
Makes an exact copy of the existing PerlinNoise object, including its random seed.
Definition at line 57 of file perlinNoise2.I.
|
inline |
Changes the scale (frequency) of the noise.
Definition at line 91 of file perlinNoise2.I.
|
inline |
Changes the scale (frequency) of the noise.
Definition at line 83 of file perlinNoise2.I.
References set_scale().
|
inline |
Changes the scale (frequency) of the noise.
Definition at line 67 of file perlinNoise2.I.
References set_scale().
Referenced by PerlinNoise2(), set_scale(), set_scale(), and set_scale().
|
inline |
Changes the scale (frequency) of the noise.
Definition at line 75 of file perlinNoise2.I.
References set_scale().