22 init_unscaled_xform();
23 _input_xform = _unscaled_xform;
34 int table_size,
unsigned long seed) :
37 init_unscaled_xform();
48 _unscaled_xform(copy._unscaled_xform),
49 _input_xform(copy._input_xform)
59 PerlinNoise::operator = (copy);
60 _unscaled_xform = copy._unscaled_xform;
61 _input_xform = copy._input_xform;
93 _input_xform = LMatrix3d::scale_mat(1.0f / value[0], 1.0f / value[1]) * _unscaled_xform;
101 return noise(LVecBase2d(x, y));
108 noise(
const LVecBase2f &value)
const {
109 return (
float)
noise(value[0], value[1]);
140 INLINE
double PerlinNoise2::
141 grad(
int hash,
double x,
double y) {
145 case 0:
return x + y;
146 case 1:
return x - y;
147 case 2:
return -x + y;
148 case 3:
return -x - y;
152 case 4:
return 1.707 * x;
153 case 5:
return 1.707 * y;
154 case 6:
return -1.707 * x;
155 case 7:
return -1.707 * y;
This is the base class for PerlinNoise2 and PerlinNoise3, different dimensions of Perlin noise implem...
void set_scale(double scale)
Changes the scale (frequency) of the noise.
double operator()(double x, double y) const
Returns the noise function of the two inputs.
This class provides an implementation of Perlin noise for 2 variables.
void operator=(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.
PerlinNoise2()
Randomizes the tables to make a unique noise function.