15 #include "perlinNoise2.h" 32 double xf = cfloor(x);
33 double yf = cfloor(y);
35 int X = ((int)xf) & _table_size_mask;
36 int Y = ((int)yf) & _table_size_mask;
47 int A = _index[X] + Y;
48 int B = _index[X + 1] + Y;
52 lerp(v, lerp(u, grad(_index[A], x, y),
53 grad(_index[B], x - 1, y)),
54 lerp(u, grad(_index[A + 1], x, y - 1),
55 grad(_index[B + 1], x - 1, y - 1)));
69 init_unscaled_xform() {
70 double rot = _randomizer.random_real(360.0f);
76 _randomizer.random_real_unit()));
LVecBase2d xform_point(const LVecBase2d &v) const
The matrix transforms a 2-component point (including translation component) and returns the result...
static LMatrix3d rotate_mat(double angle)
Returns a matrix that rotates by the given angle in degrees counterclockwise.
This is the base class for all two-component vectors and points.
void set_row(int row, const LVecBase3d &v)
Replaces the indicated row of the matrix from a three-component vector.
double noise(double x, double y) const
Returns the noise function of the three inputs.