23 PerlinNoise(
int table_size,
unsigned long seed) :
24 _table_size(table_size),
25 _table_size_mask(table_size - 1),
30 if (_table_size != 0) {
31 bool table_size_power_2 = ((_table_size ^ _table_size_mask) == (_table_size + _table_size_mask));
32 nassertd(table_size_power_2) {
40 _index.reserve(_table_size * 2);
42 for (i = 0; i < _table_size; ++i) {
45 for (i = 0; i < _table_size; ++i) {
46 int j = _randomizer.random_int(_table_size);
47 nassertv(j >= 0 && j < _table_size);
49 _index[i] = _index[j];
54 for (i = 0; i < _table_size; ++i) {
55 _index.push_back(_index[i]);
65 _table_size(copy._table_size),
66 _table_size_mask(copy._table_size_mask),
67 _randomizer(copy._randomizer),
78 _table_size = copy._table_size;
79 _table_size_mask = copy._table_size_mask;
80 _randomizer = copy._randomizer;
This is the base class for PerlinNoise2 and PerlinNoise3, different dimensions of Perlin noise implem...
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.