Shorten ManualMapVoxelManipulator to MMVManip
[oweals/minetest.git] / src / cavegen.h
1 /*
2 Minetest
3 Copyright (C) 2010-2013 kwolekr, Ryan Kwolek <kwolekr@minetest.net>
4
5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU Lesser General Public License as published by
7 the Free Software Foundation; either version 2.1 of the License, or
8 (at your option) any later version.
9
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13 GNU Lesser General Public License for more details.
14
15 You should have received a copy of the GNU Lesser General Public License along
16 with this program; if not, write to the Free Software Foundation, Inc.,
17 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
18 */
19
20 #ifndef CAVEGEN_HEADER
21 #define CAVEGEN_HEADER
22
23 #define VMANIP_FLAG_CAVE VOXELFLAG_CHECKED1
24
25 class MapgenV6;
26 class MapgenV7;
27
28 class CaveV6 {
29 public:
30         MapgenV6 *mg;
31         MMVManip *vm;
32         INodeDefManager *ndef;
33
34         s16 min_tunnel_diameter;
35         s16 max_tunnel_diameter;
36         u16 tunnel_routepoints;
37         int dswitchint;
38         int part_max_length_rs;
39
40         bool large_cave;
41         bool large_cave_is_flat;
42         bool flooded;
43
44         s16 max_stone_y;
45         v3s16 node_min;
46         v3s16 node_max;
47
48         v3f orp;  // starting point, relative to caved space
49         v3s16 of; // absolute coordinates of caved space
50         v3s16 ar; // allowed route area
51         s16 rs;   // tunnel radius size
52         v3f main_direction;
53
54         s16 route_y_min;
55         s16 route_y_max;
56
57         PseudoRandom *ps;
58         PseudoRandom *ps2;
59
60         content_t c_water_source;
61         content_t c_lava_source;
62
63         int water_level;
64
65         CaveV6() {}
66         CaveV6(MapgenV6 *mg, PseudoRandom *ps, PseudoRandom *ps2, bool large_cave);
67         void makeCave(v3s16 nmin, v3s16 nmax, int max_stone_height);
68         void makeTunnel(bool dirswitch);
69         void carveRoute(v3f vec, float f, bool randomize_xz);
70 };
71
72 class CaveV7 {
73 public:
74         MapgenV7 *mg;
75         MMVManip *vm;
76         INodeDefManager *ndef;
77
78         NoiseParams *np_caveliquids;
79
80         s16 min_tunnel_diameter;
81         s16 max_tunnel_diameter;
82         u16 tunnel_routepoints;
83         int dswitchint;
84         int part_max_length_rs;
85
86         bool large_cave;
87         bool large_cave_is_flat;
88         bool flooded;
89
90         s16 max_stone_y;
91         v3s16 node_min;
92         v3s16 node_max;
93
94         v3f orp;  // starting point, relative to caved space
95         v3s16 of; // absolute coordinates of caved space
96         v3s16 ar; // allowed route area
97         s16 rs;   // tunnel radius size
98         v3f main_direction;
99
100         s16 route_y_min;
101         s16 route_y_max;
102
103         PseudoRandom *ps;
104
105         content_t c_water_source;
106         content_t c_lava_source;
107         content_t c_ice;
108
109         int water_level;
110
111         CaveV7() {}
112         CaveV7(MapgenV7 *mg, PseudoRandom *ps, bool large_cave);
113         void makeCave(v3s16 nmin, v3s16 nmax, int max_stone_height);
114         void makeTunnel(bool dirswitch);
115         void carveRoute(v3f vec, float f, bool randomize_xz, bool is_ravine);
116 };
117
118 #endif