21 noise(
const LVecBase2d &value)
const {
23 LVecBase2d vec = _input_xform.xform_point(value);
29 double xf = cfloor(x);
30 double yf = cfloor(y);
32 int X = ((int)xf) & _table_size_mask;
33 int Y = ((int)yf) & _table_size_mask;
44 int A = _index[X] + Y;
45 int B = _index[X + 1] + Y;
49 lerp(v, lerp(u, grad(_index[A], x, y),
50 grad(_index[B], x - 1, y)),
51 lerp(u, grad(_index[A + 1], x, y - 1),
52 grad(_index[B + 1], x - 1, y - 1)));
63 init_unscaled_xform() {
64 double rot = _randomizer.random_real(360.0f);
65 _unscaled_xform = LMatrix3d::rotate_mat(rot);
69 _unscaled_xform.set_row(2, LVecBase2d(_randomizer.random_real_unit(),
70 _randomizer.random_real_unit()));
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
double noise(double x, double y) const
Returns the noise function of the three inputs.