Luanti 5.11.0-dev
 
Loading...
Searching...
No Matches
mapgen_fractal.h
Go to the documentation of this file.
1// Luanti
2// SPDX-License-Identifier: LGPL-2.1-or-later
3// Copyright (C) 2015-2019 paramat
4// Copyright (C) 2015-2016 kwolekr, Ryan Kwolek
5
6#pragma once
7
8#include "mapgen.h"
9
11#define MGFRACTAL_TERRAIN 0x01
12
13class BiomeManager;
14
16
17
19{
20 float cave_width = 0.09f;
26 float large_cave_flooded = 0.5f;
27 s16 dungeon_ymin = -31000;
28 s16 dungeon_ymax = 31000;
29 u16 fractal = 1;
30 u16 iterations = 11;
31 v3f scale = v3f(4096.0, 1024.0, 4096.0);
32 v3f offset = v3f(1.52, 0.0, 0.0);
33 float slice_w = 0.0f;
34 float julia_x = 0.267f;
35 float julia_y = 0.2f;
36 float julia_z = 0.133f;
37 float julia_w = 0.067f;
38
44
47
48 void readParams(const Settings *settings);
49 void writeParams(Settings *settings) const;
51};
52
53
55{
56public:
59
60 virtual MapgenType getType() const { return MAPGEN_FRACTAL; }
61
62 virtual void makeChunk(BlockMakeData *data);
64 bool getFractalAtPoint(s16 x, s16 y, s16 z);
65 s16 generateTerrain();
66
67private:
69 bool julia;
74 float slice_w;
75 float julia_x;
76 float julia_y;
77 float julia_z;
78 float julia_w;
79 Noise *noise_seabed = nullptr;
80};
Definition mg_biome.h:203
Definition emerge.h:85
Definition mapgen.h:281
Definition mapgen_fractal.h:55
float julia_y
Definition mapgen_fractal.h:76
u16 formula
Definition mapgen_fractal.h:68
~MapgenFractal()
Definition mapgen_fractal.cpp:75
float julia_x
Definition mapgen_fractal.h:75
int getSpawnLevelAtPoint(v2s16 p)
Definition mapgen_fractal.cpp:163
bool getFractalAtPoint(s16 x, s16 y, s16 z)
Definition mapgen_fractal.cpp:263
float julia_w
Definition mapgen_fractal.h:78
virtual MapgenType getType() const
Definition mapgen_fractal.h:60
u16 fractal
Definition mapgen_fractal.h:70
virtual void makeChunk(BlockMakeData *data)
Definition mapgen_fractal.cpp:193
float slice_w
Definition mapgen_fractal.h:74
v3f offset
Definition mapgen_fractal.h:73
float julia_z
Definition mapgen_fractal.h:77
bool julia
Definition mapgen_fractal.h:69
MapgenFractal(MapgenFractalParams *params, EmergeParams *emerge)
Definition mapgen_fractal.cpp:35
Noise * noise_seabed
Definition mapgen_fractal.h:79
s16 generateTerrain()
Definition mapgen_fractal.cpp:393
u16 iterations
Definition mapgen_fractal.h:71
v3f scale
Definition mapgen_fractal.h:72
Definition noise.h:146
Definition settings.h:109
static const char * settings[]
Definition fontengine.cpp:27
core::vector2d< s16 > v2s16
Definition irr_v2d.h:12
core::vector3df v3f
Definition irr_v3d.h:11
MapgenType
Definition mapgen.h:102
@ MAPGEN_FRACTAL
Definition mapgen.h:108
FlagDesc flagdesc_mapgen_fractal[]
Definition mapgen_fractal.cpp:27
Definition emerge.h:37
Definition string.h:67
Definition mapgen_fractal.h:19
u16 fractal
Definition mapgen_fractal.h:29
float cave_width
Definition mapgen_fractal.h:20
NoiseParams np_cave1
Definition mapgen_fractal.h:41
float slice_w
Definition mapgen_fractal.h:33
s16 large_cave_depth
Definition mapgen_fractal.h:21
void setDefaultSettings(Settings *settings)
Definition mapgen_fractal.cpp:153
float julia_y
Definition mapgen_fractal.h:35
~MapgenFractalParams()=default
u16 large_cave_num_min
Definition mapgen_fractal.h:24
NoiseParams np_seabed
Definition mapgen_fractal.h:39
void readParams(const Settings *settings)
Definition mapgen_fractal.cpp:92
s16 dungeon_ymin
Definition mapgen_fractal.h:27
u16 small_cave_num_min
Definition mapgen_fractal.h:22
u16 iterations
Definition mapgen_fractal.h:30
u16 large_cave_num_max
Definition mapgen_fractal.h:25
NoiseParams np_filler_depth
Definition mapgen_fractal.h:40
float large_cave_flooded
Definition mapgen_fractal.h:26
float julia_z
Definition mapgen_fractal.h:36
NoiseParams np_cave2
Definition mapgen_fractal.h:42
v3f scale
Definition mapgen_fractal.h:31
v3f offset
Definition mapgen_fractal.h:32
float julia_w
Definition mapgen_fractal.h:37
MapgenFractalParams()
Definition mapgen_fractal.cpp:82
u16 small_cave_num_max
Definition mapgen_fractal.h:23
NoiseParams np_dungeons
Definition mapgen_fractal.h:43
void writeParams(Settings *settings) const
Definition mapgen_fractal.cpp:123
float julia_x
Definition mapgen_fractal.h:34
s16 dungeon_ymax
Definition mapgen_fractal.h:28
Definition mapgen.h:114
Definition noise.h:119
static std::string p(std::string path)
Definition test_filesys.cpp:53