27 init_unscaled_xform();
28 _input_xform = _unscaled_xform;
42 int table_size,
unsigned long seed) :
45 init_unscaled_xform();
58 _unscaled_xform(copy._unscaled_xform),
59 _input_xform(copy._input_xform)
71 PerlinNoise::operator = (copy);
72 _unscaled_xform = copy._unscaled_xform;
73 _input_xform = copy._input_xform;
113 _input_xform =
LMatrix4d::scale_mat(1.0f / value[0], 1.0f / value[1], 1.0f / value[2]) * _unscaled_xform;
122 noise(
double x,
double y,
double z)
const {
133 return (
float)
noise(value[0], value[1], value[2]);
143 return noise(x, y, z);
173 INLINE
double PerlinNoise3::
174 grad(
int hash,
double x,
double y,
double z) {
186 case 0:
return x + y;
187 case 1:
return -x + y;
188 case 2:
return x - y;
189 case 3:
return -x - y;
191 case 4:
return x + z;
192 case 5:
return -x + z;
193 case 6:
return x - z;
194 case 7:
return -x - z;
196 case 8:
return y + z;
197 case 9:
return -y + z;
198 case 10:
return y - z;
199 case 11:
return -y - z;
201 case 12:
return x + y;
202 case 13:
return -y + z;
203 case 14:
return -x + y;
204 case 15:
return -y - z;
This is the base class for PerlinNoise2 and PerlinNoise3, different dimensions of Perlin noise implem...
This is the base class for all three-component vectors and points.
void operator=(const PerlinNoise3 ©)
Makes an exact copy of the existing PerlinNoise object, including its random seed.
double noise(double x, double y, double z) const
Returns the noise function of the three inputs.
double operator()(double x, double y, double z) const
Returns the noise function of the three inputs.
static LMatrix4d scale_mat(const LVecBase3d &scale)
Returns a matrix that applies the indicated scale in each of the three axes.
PerlinNoise3()
Randomizes the tables to make a unique noise function.
This class provides an implementation of Perlin noise for 3 variables.
void set_scale(double scale)
Changes the scale (frequency) of the noise.
This is the base class for all three-component vectors and points.