21 noise(
const LVecBase3d &value)
const {
23 LVecBase3d vec = _input_xform.xform_point(value);
30 double xf = cfloor(x);
31 double yf = cfloor(y);
32 double zf = cfloor(z);
34 int X = ((int)xf) & _table_size_mask;
35 int Y = ((int)yf) & _table_size_mask;
36 int Z = ((int)zf) & _table_size_mask;
50 int A = _index[X] + Y;
51 int AA = _index[A] + Z;
52 int AB = _index[A + 1] + Z;
53 int B = _index[X + 1] + Y;
54 int BA = _index[B] + Z;
55 int BB = _index[B + 1] + Z;
59 lerp(w, lerp(v, lerp(u, grad(_index[AA], x, y, z),
60 grad(_index[BA], x - 1, y, z)),
61 lerp(u, grad(_index[AB], x, y - 1, z),
62 grad(_index[BB], x - 1, y - 1, z))),
63 lerp(v, lerp(u, grad(_index[AA + 1], x, y, z - 1),
64 grad(_index[BA + 1], x - 1, y, z - 1)),
65 lerp(u, grad(_index[AB + 1], x, y - 1, z - 1),
66 grad(_index[BB + 1], x - 1, y - 1, z - 1))));
77 init_unscaled_xform() {
78 LRotationd rot(_randomizer.random_real_unit(),
79 _randomizer.random_real_unit(),
80 _randomizer.random_real_unit(),
81 _randomizer.random_real_unit());
83 rot.extract_to_matrix(_unscaled_xform);
87 _unscaled_xform.set_row(3, LVecBase3d(_randomizer.random_real_unit(),
88 _randomizer.random_real_unit(),
89 _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, double z) const
Returns the noise function of the three inputs.