1 | /* |
1 | /* |
2 | * This file is part of Deliantra, the Roguelike Realtime MMORPG. |
2 | * This file is part of Deliantra, the Roguelike Realtime MMORPG. |
3 | * |
3 | * |
4 | * Copyright (©) 2010,2011,2012 Marc Alexander Lehmann / Robin Redeker / the Deliantra team |
4 | * Copyright (©) 2010,2011,2012 Marc Alexander Lehmann / Robin Redeker / the Deliantra team |
5 | * |
5 | * |
6 | * Deliantra is free software: you can redistribute it and/or modify it under |
6 | * Deliantra is free software: you can redistribute it and/or modify it under |
7 | * the terms of the Affero GNU General Public License as published by the |
7 | * the terms of the Affero GNU General Public License as published by the |
8 | * Free Software Foundation, either version 3 of the License, or (at your |
8 | * Free Software Foundation, either version 3 of the License, or (at your |
9 | * option) any later version. |
9 | * option) any later version. |
10 | * |
10 | * |
11 | * This program is distributed in the hope that it will be useful, |
11 | * This program is distributed in the hope that it will be useful, |
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
14 | * GNU General Public License for more details. |
14 | * GNU General Public License for more details. |
15 | * |
15 | * |
16 | * You should have received a copy of the Affero GNU General Public License |
16 | * You should have received a copy of the Affero GNU General Public License |
17 | * and the GNU General Public License along with this program. If not, see |
17 | * and the GNU General Public License along with this program. If not, see |
18 | * <http://www.gnu.org/licenses/>. |
18 | * <http://www.gnu.org/licenses/>. |
19 | * |
19 | * |
20 | * The authors can be reached via e-mail to <support@deliantra.net> |
20 | * The authors can be reached via e-mail to <support@deliantra.net> |
21 | */ |
21 | */ |
22 | |
22 | |
23 | #ifndef NOISE_H_ |
23 | #ifndef NOISE_H_ |
24 | #define NOISE_H_ |
24 | #define NOISE_H_ |
25 | |
25 | |
|
|
26 | #include <string.h> // workaround for tinyvec using memcpy without including string.h |
26 | #include <blitz/tinyvec.h> |
27 | #include <blitz/tinyvec.h> |
27 | #include <blitz/tinyvec-et.h> |
28 | #include <blitz/tinyvec-et.h> |
28 | |
29 | |
29 | #include "global.h" |
30 | #include "global.h" |
30 | |
31 | |
… | |
… | |
218 | |
219 | |
219 | frac_gen (int octaves = 3, value_t lacunarity = 2, value_t hurst_expo = .5, uint32_t seed = 0); |
220 | frac_gen (int octaves = 3, value_t lacunarity = 2, value_t hurst_expo = .5, uint32_t seed = 0); |
220 | |
221 | |
221 | value_t noise (vec_t P, uint32_t seed = 0) func_pure |
222 | value_t noise (vec_t P, uint32_t seed = 0) func_pure |
222 | { |
223 | { |
223 | return operator() (P, seed); |
224 | return this->operator() (P, seed); |
224 | } |
225 | } |
225 | |
226 | |
226 | value_t fBm (vec_t P) func_pure; |
227 | value_t fBm (vec_t P) func_pure; |
227 | value_t turbulence (vec_t P) func_pure; |
228 | value_t turbulence (vec_t P) func_pure; |
228 | value_t multifractal (vec_t P, value_t offset = 1) func_pure; |
229 | value_t multifractal (vec_t P, value_t offset = 1) func_pure; |