3 Copyright (C) 2015-2019 paramat
4 Copyright (C) 2015-2016 kwolekr, Ryan Kwolek
6 Fractal formulas from http://www.bugman123.com/Hypercomplex/index.html
7 by Paul Nylander, and from http://www.fractalforums.com, thank you.
9 This program is free software; you can redistribute it and/or modify
10 it under the terms of the GNU Lesser General Public License as published by
11 the Free Software Foundation; either version 2.1 of the License, or
12 (at your option) any later version.
14 This program is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 GNU Lesser General Public License for more details.
19 You should have received a copy of the GNU Lesser General Public License along
20 with this program; if not, write to the Free Software Foundation, Inc.,
21 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
28 ///////////// Mapgen Fractal flags
29 #define MGFRACTAL_TERRAIN 0x01
33 extern FlagDesc flagdesc_mapgen_fractal
[];
36 struct MapgenFractalParams
: public MapgenParams
38 float cave_width
= 0.09f
;
39 s16 large_cave_depth
= -33;
40 u16 small_cave_num_min
= 0;
41 u16 small_cave_num_max
= 0;
42 u16 large_cave_num_min
= 0;
43 u16 large_cave_num_max
= 2;
44 float large_cave_flooded
= 0.5f
;
45 s16 dungeon_ymin
= -31000;
46 s16 dungeon_ymax
= 31000;
49 v3f scale
= v3f(4096.0, 1024.0, 4096.0);
50 v3f offset
= v3f(1.52, 0.0, 0.0);
52 float julia_x
= 0.267f
;
54 float julia_z
= 0.133f
;
55 float julia_w
= 0.067f
;
57 NoiseParams np_seabed
;
58 NoiseParams np_filler_depth
;
61 NoiseParams np_dungeons
;
63 MapgenFractalParams();
64 ~MapgenFractalParams() = default;
66 void readParams(const Settings
*settings
);
67 void writeParams(Settings
*settings
) const;
68 void setDefaultSettings(Settings
*settings
);
72 class MapgenFractal
: public MapgenBasic
75 MapgenFractal(MapgenFractalParams
*params
, EmergeParams
*emerge
);
78 virtual MapgenType
getType() const { return MAPGEN_FRACTAL
; }
80 virtual void makeChunk(BlockMakeData
*data
);
81 int getSpawnLevelAtPoint(v2s16 p
);
82 bool getFractalAtPoint(s16 x
, s16 y
, s16 z
);
83 s16
generateTerrain();
97 Noise
*noise_seabed
= nullptr;