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 (double sx, double sy, int table_size=256, unsigned long seed=0) | |
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. | |
double | noise (double x, double y) 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 (const LVecBase2d &value) const |
Returns the noise function of the three 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. | |
double | operator() (const LVecBase2d &value) 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 (double sx, double sy) |
Changes the scale (frequency) of the noise. | |
void | set_scale (double scale) |
Changes the scale (frequency) of the noise. | |
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. |
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/ .
Definition at line 28 of file perlinNoise2.h.
PerlinNoise2::PerlinNoise2 | ( | ) | [inline] |
Randomizes the tables to make a unique noise function.
Uses a default scale (noise frequency), table size, and seed.
Definition at line 24 of file perlinNoise2.I.
PerlinNoise2::PerlinNoise2 | ( | double | sx, |
double | sy, | ||
int | table_size = 256 , |
||
unsigned long | seed = 0 |
||
) | [inline] |
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 41 of file perlinNoise2.I.
References set_scale().
PerlinNoise2::PerlinNoise2 | ( | const PerlinNoise2 & | copy | ) | [inline] |
Makes an exact copy of the existing PerlinNoise object, including its random seed.
Definition at line 56 of file perlinNoise2.I.
double PerlinNoise2::noise | ( | double | x, |
double | y | ||
) | const [inline] |
Returns the noise function of the three inputs.
Definition at line 122 of file perlinNoise2.I.
Referenced by noise(), operator()(), and PNMImage::perlin_noise_fill().
double PerlinNoise2::noise | ( | const LVecBase2d & | value | ) | const |
Returns the noise function of the three inputs.
Definition at line 24 of file perlinNoise2.cxx.
References PerlinNoise::fade(), PerlinNoise::lerp(), and LMatrix3d::xform_point().
float PerlinNoise2::noise | ( | const LVecBase2f & | value | ) | const [inline] |
Returns the noise function of the three inputs.
Definition at line 132 of file perlinNoise2.I.
References noise().
double PerlinNoise2::operator() | ( | const LVecBase2d & | value | ) | const [inline] |
Returns the noise function of the two inputs.
Definition at line 162 of file perlinNoise2.I.
References noise().
double PerlinNoise2::operator() | ( | double | x, |
double | y | ||
) | const [inline] |
Returns the noise function of the two inputs.
Definition at line 142 of file perlinNoise2.I.
References noise().
float PerlinNoise2::operator() | ( | const LVecBase2f & | value | ) | const [inline] |
Returns the noise function of the two inputs.
Definition at line 152 of file perlinNoise2.I.
References noise().
void PerlinNoise2::operator= | ( | const PerlinNoise2 & | copy | ) | [inline] |
Makes an exact copy of the existing PerlinNoise object, including its random seed.
Definition at line 70 of file perlinNoise2.I.
void PerlinNoise2::set_scale | ( | const LVecBase2f & | scale | ) | [inline] |
Changes the scale (frequency) of the noise.
Definition at line 102 of file perlinNoise2.I.
References set_scale().
void PerlinNoise2::set_scale | ( | double | scale | ) | [inline] |
Changes the scale (frequency) of the noise.
Definition at line 82 of file perlinNoise2.I.
Referenced by PerlinNoise2(), and set_scale().
void PerlinNoise2::set_scale | ( | double | sx, |
double | sy | ||
) | [inline] |
Changes the scale (frequency) of the noise.
Definition at line 92 of file perlinNoise2.I.
References set_scale().
void PerlinNoise2::set_scale | ( | const LVecBase2d & | scale | ) | [inline] |
Changes the scale (frequency) of the noise.
Definition at line 112 of file perlinNoise2.I.
References LMatrix3d::scale_mat().