Cuberite
A lightweight, fast and extensible game server for Minecraft
DistortedHeightmap.cpp
Go to the documentation of this file.
1 
2 // DistortedHeightmap.cpp
3 
4 // Implements the cDistortedHeightmap class representing the height and composition generator capable of overhangs
5 
6 #include "Globals.h"
7 
8 #include "DistortedHeightmap.h"
9 #include "../IniFile.h"
10 #include "../LinearUpscale.h"
11 
12 
13 
14 
15 
17 // cDistortedHeightmap:
18 
27 {
28  /* Biome | AmpX | AmpZ */
29  /* biOcean */ { 1.5f, 1.5f},
30  /* biPlains */ { 0.5f, 0.5f},
31  /* biDesert */ { 0.5f, 0.5f},
32  /* biExtremeHills */ {16.0f, 16.0f},
33  /* biForest */ { 3.0f, 3.0f},
34  /* biTaiga */ { 1.5f, 1.5f},
35 
36  /* biSwampland */ { 0.0f, 0.0f},
37  /* biRiver */ { 0.0f, 0.0f},
38  /* biNether */ { 0.0f, 0.0f}, // Unused, but must be here due to indexing
39  /* biSky */ { 0.0f, 0.0f}, // Unused, but must be here due to indexing
40  /* biFrozenOcean */ { 0.0f, 0.0f},
41  /* biFrozenRiver */ { 0.0f, 0.0f},
42  /* biIcePlains */ { 0.0f, 0.0f},
43  /* biIceMountains */ { 8.0f, 8.0f},
44  /* biMushroomIsland */ { 4.0f, 4.0f},
45  /* biMushroomShore */ { 0.0f, 0.0f},
46  /* biBeach */ { 0.0f, 0.0f},
47  /* biDesertHills */ { 5.0f, 5.0f},
48  /* biForestHills */ { 6.0f, 6.0f},
49  /* biTaigaHills */ { 8.0f, 8.0f},
50  /* biExtremeHillsEdge */ { 7.0f, 7.0f},
51  /* biJungle */ { 4.0f, 4.0f},
52  /* biJungleHills */ { 8.0f, 8.0f},
53  /* biJungleEdge */ { 3.0f, 3.0f}, // 23
54  /* biDeepOcean */ { 1.0f, 1.0f}, // 24
55  /* biStoneBeach */ { 1.0f, 1.0f}, // 25
56  /* biColdBeach */ { 1.0f, 1.0f}, // 26
57  /* biBirchForest */ { 3.0f, 3.0f}, // 27
58  /* biBirchForestHills */ { 6.0f, 6.0f}, // 28
59  /* biRoofedForest */ { 3.0f, 3.0f}, // 29
60  /* biColdTaiga */ { 0.5f, 0.5f}, // 30
61  /* biColdTaigaHills */ { 4.0f, 4.0f}, // 31
62  /* biMegaTaiga */ { 1.0f, 1.0f}, // 32
63  /* biMegaTaigaHills */ { 4.0f, 4.0f}, // 33
64  /* biExtremeHillsPlus */ {32.0f, 32.0f}, // 34 - anyone say extreme plus? Make it extreme plus, then :)
65  /* biSavanna */ { 2.0f, 2.0f}, // 35
66  /* biSavannaPlateau */ { 3.0f, 3.0f}, // 36
67  /* biMesa */ { 2.0f, 2.0f}, // 37
68  /* biMesaPlateauF */ { 2.0f, 2.0f}, // 38
69  /* biMesaPlateau */ { 2.0f, 2.0f}, // 39
70 
71  // biomes 40 .. 128 are unused, 89 empty placeholders here:
72  {0.0f, 0.0f}, {0.0f, 0.0f}, {0.0f, 0.0f}, {0.0f, 0.0f}, {0.0f, 0.0f}, {0.0f, 0.0f}, {0.0f, 0.0f}, {0.0f, 0.0f}, {0.0f, 0.0f}, {0.0f, 0.0f}, // 40 .. 49
73  {0.0f, 0.0f}, {0.0f, 0.0f}, {0.0f, 0.0f}, {0.0f, 0.0f}, {0.0f, 0.0f}, {0.0f, 0.0f}, {0.0f, 0.0f}, {0.0f, 0.0f}, {0.0f, 0.0f}, {0.0f, 0.0f}, // 50 .. 59
74  {0.0f, 0.0f}, {0.0f, 0.0f}, {0.0f, 0.0f}, {0.0f, 0.0f}, {0.0f, 0.0f}, {0.0f, 0.0f}, {0.0f, 0.0f}, {0.0f, 0.0f}, {0.0f, 0.0f}, {0.0f, 0.0f}, // 60 .. 69
75  {0.0f, 0.0f}, {0.0f, 0.0f}, {0.0f, 0.0f}, {0.0f, 0.0f}, {0.0f, 0.0f}, {0.0f, 0.0f}, {0.0f, 0.0f}, {0.0f, 0.0f}, {0.0f, 0.0f}, {0.0f, 0.0f}, // 70 .. 79
76  {0.0f, 0.0f}, {0.0f, 0.0f}, {0.0f, 0.0f}, {0.0f, 0.0f}, {0.0f, 0.0f}, {0.0f, 0.0f}, {0.0f, 0.0f}, {0.0f, 0.0f}, {0.0f, 0.0f}, {0.0f, 0.0f}, // 80 .. 89
77  {0.0f, 0.0f}, {0.0f, 0.0f}, {0.0f, 0.0f}, {0.0f, 0.0f}, {0.0f, 0.0f}, {0.0f, 0.0f}, {0.0f, 0.0f}, {0.0f, 0.0f}, {0.0f, 0.0f}, {0.0f, 0.0f}, // 90 .. 99
78  {0.0f, 0.0f}, {0.0f, 0.0f}, {0.0f, 0.0f}, {0.0f, 0.0f}, {0.0f, 0.0f}, {0.0f, 0.0f}, {0.0f, 0.0f}, {0.0f, 0.0f}, {0.0f, 0.0f}, {0.0f, 0.0f}, // 100 .. 109
79  {0.0f, 0.0f}, {0.0f, 0.0f}, {0.0f, 0.0f}, {0.0f, 0.0f}, {0.0f, 0.0f}, {0.0f, 0.0f}, {0.0f, 0.0f}, {0.0f, 0.0f}, {0.0f, 0.0f}, {0.0f, 0.0f}, // 110 .. 119
80  {0.0f, 0.0f}, {0.0f, 0.0f}, {0.0f, 0.0f}, {0.0f, 0.0f}, {0.0f, 0.0f}, {0.0f, 0.0f}, {0.0f, 0.0f}, {0.0f, 0.0f}, {0.0f, 0.0f}, // 120 .. 128
81 
82  // Release 1.7 biome variants:
83  /* biSunflowerPlains */ { 1.0f, 1.0f}, // 129
84  /* biDesertM */ { 1.0f, 1.0f}, // 130
85  /* biExtremeHillsM */ {16.0f, 16.0f}, // 131
86  /* biFlowerForest */ { 4.0f, 4.0f}, // 132
87  /* biTaigaM */ { 3.0f, 3.0f}, // 133
88  /* biSwamplandM */ { 0.0f, 0.0f}, // 134
89 
90  // Biomes 135 .. 139 unused, 5 empty placeholders here:
91  {0.0f, 0.0f}, {0.0f, 0.0f}, {0.0f, 0.0f}, {0.0f, 0.0f}, {0.0f, 0.0f}, // 135 .. 139
92 
93  /* biIcePlainsSpikes */ { 1.0f, 1.0f}, // 140
94 
95  // Biomes 141 .. 148 unused, 8 empty placeholders here:
96  {0.0f, 0.0f}, {0.0f, 0.0f}, {0.0f, 0.0f}, {0.0f, 0.0f}, {0.0f, 0.0f}, {0.0f, 0.0f}, {0.0f, 0.0f}, {0.0f, 0.0f}, // 141 .. 148
97 
98  /* biJungleM */ { 4.0f, 4.0f}, // 149
99  {0.0f, 0.0f}, // 150
100  /* biJungleEdgeM */ { 3.0f, 3.0f}, // 151
101  {0.0f, 0.0f}, {0.0f, 0.0f}, {0.0f, 0.0f}, // 152 .. 154
102  /* biBirchForestM */ { 3.0f, 3.0f}, // 155
103  /* biBirchForestHillsM */ { 5.0f, 5.0f}, // 156
104  /* biRoofedForestM */ { 2.0f, 2.0f}, // 157
105  /* biColdTaigaM */ { 1.0f, 1.0f}, // 158
106  {0.0f, 0.0f}, // 159
107  /* biMegaSpruceTaiga */ { 3.0f, 3.0f}, // 160
108  /* biMegaSpruceTaigaHills */ { 3.0f, 3.0f}, // 161
109  /* biExtremeHillsPlusM */ {32.0f, 32.0f}, // 162
110  /* biSavannaM */ { 2.0f, 2.0f}, // 163
111  /* biSavannaPlateauM */ { 3.0f, 3.0f}, // 164
112  /* biMesaBryce */ { 0.5f, 0.5f}, // 165
113  /* biMesaPlateauFM */ { 2.0f, 2.0f}, // 166
114  /* biMesaPlateauM */ { 2.0f, 2.0f}, // 167
115 } ;
116 
117 
118 
119 
120 
122  m_NoiseDistortX(a_Seed + 1000),
123  m_NoiseDistortZ(a_Seed + 2000),
124  m_CurChunkCoords(0x7fffffff, 0x7fffffff), // Set impossible coords for the chunk so that it's always considered stale
125  m_BiomeGen(a_BiomeGen),
126  m_UnderlyingHeiGen(a_Seed, a_BiomeGen),
127  m_HeightGen(m_UnderlyingHeiGen, 64),
128  m_IsInitialized(false)
129 {
130  m_NoiseDistortX.AddOctave(static_cast<NOISE_DATATYPE>(1), static_cast<NOISE_DATATYPE>(0.5));
131  m_NoiseDistortX.AddOctave(static_cast<NOISE_DATATYPE>(0.5), static_cast<NOISE_DATATYPE>(1));
132  m_NoiseDistortX.AddOctave(static_cast<NOISE_DATATYPE>(0.25), static_cast<NOISE_DATATYPE>(2));
133 
134  m_NoiseDistortZ.AddOctave(static_cast<NOISE_DATATYPE>(1), static_cast<NOISE_DATATYPE>(0.5));
135  m_NoiseDistortZ.AddOctave(static_cast<NOISE_DATATYPE>(0.5), static_cast<NOISE_DATATYPE>(1));
136  m_NoiseDistortZ.AddOctave(static_cast<NOISE_DATATYPE>(0.25), static_cast<NOISE_DATATYPE>(2));
137 }
138 
139 
140 
141 
142 
144 {
145  if (m_IsInitialized)
146  {
147  return;
148  }
149 
150  // Read the params from the INI file:
151  m_SeaLevel = a_IniFile.GetValueSetI("Generator", "SeaLevel", 62);
152  m_FrequencyX = static_cast<NOISE_DATATYPE>(a_IniFile.GetValueSetF("Generator", "DistortedHeightmapFrequencyX", 10));
153  m_FrequencyY = static_cast<NOISE_DATATYPE>(a_IniFile.GetValueSetF("Generator", "DistortedHeightmapFrequencyY", 10));
154  m_FrequencyZ = static_cast<NOISE_DATATYPE>(a_IniFile.GetValueSetF("Generator", "DistortedHeightmapFrequencyZ", 10));
155 
156  m_IsInitialized = true;
157 }
158 
159 
160 
161 
162 
164 {
165  if (m_CurChunkCoords == a_ChunkCoords)
166  {
167  return;
168  }
169  m_CurChunkCoords = a_ChunkCoords;
170 
171 
175 }
176 
177 
178 
179 
180 
182 {
183  // Generate distortion noise:
184  NOISE_DATATYPE DistortNoiseX[DIM_X * DIM_Y * DIM_Z];
185  NOISE_DATATYPE DistortNoiseZ[DIM_X * DIM_Y * DIM_Z];
186  NOISE_DATATYPE Workspace[DIM_X * DIM_Y * DIM_Z];
189  NOISE_DATATYPE StartY = 0;
190  NOISE_DATATYPE EndY = static_cast<NOISE_DATATYPE>(257) / m_FrequencyY;
193 
194  m_NoiseDistortX.Generate3D(DistortNoiseX, DIM_X, DIM_Y, DIM_Z, StartX, EndX, StartY, EndY, StartZ, EndZ, Workspace);
195  m_NoiseDistortZ.Generate3D(DistortNoiseZ, DIM_X, DIM_Y, DIM_Z, StartX, EndX, StartY, EndY, StartZ, EndZ, Workspace);
196 
197  // The distorted heightmap, before linear upscaling
198  NOISE_DATATYPE DistHei[DIM_X * DIM_Y * DIM_Z];
199 
200  // Distort the heightmap using the distortion:
201  for (int z = 0; z < DIM_Z; z++)
202  {
203  int AmpIdx = z * DIM_X;
204  for (int y = 0; y < DIM_Y; y++)
205  {
206  int NoiseArrayIdx = z * DIM_X * DIM_Y + y * DIM_X;
207  for (int x = 0; x < DIM_X; x++)
208  {
209  NOISE_DATATYPE DistX = DistortNoiseX[NoiseArrayIdx + x] * m_DistortAmpX[AmpIdx + x];
210  NOISE_DATATYPE DistZ = DistortNoiseZ[NoiseArrayIdx + x] * m_DistortAmpZ[AmpIdx + x];
211  DistX += static_cast<NOISE_DATATYPE>(m_CurChunkCoords.m_ChunkX * cChunkDef::Width + x * INTERPOL_X);
212  DistZ += static_cast<NOISE_DATATYPE>(m_CurChunkCoords.m_ChunkZ * cChunkDef::Width + z * INTERPOL_Z);
213  // Adding 0.5 helps alleviate the interpolation artifacts
214  DistHei[NoiseArrayIdx + x] = static_cast<NOISE_DATATYPE>(GetHeightmapAt(DistX, DistZ)) + static_cast<NOISE_DATATYPE>(0.5);
215  }
216  }
217  }
218 
219  // Upscale the distorted heightmap into full dimensions:
221  DistHei, DIM_X, DIM_Y, DIM_Z,
223  );
224 
225  // DEBUG: Debug3DNoise(m_DistortedHeightmap, 17, 257, 17, fmt::format(FMT_STRING("DistortedHeightmap_{}_{}"), m_CurChunkX, m_CurChunkZ));
226 }
227 
228 
229 
230 
231 
233 {
234  PrepareState(a_ChunkCoords);
235  for (int z = 0; z < cChunkDef::Width; z++)
236  {
237  for (int x = 0; x < cChunkDef::Width; x++)
238  {
239  int idx = x + 17 * 257 * z;
240  for (int y = 0; y < cChunkDef::Height; y++)
241  {
242  a_Shape[y + x * 256 + z * 16 * 256] = (y < m_DistortedHeightmap[idx + y * 17]) ? 1 : 0;
243  } // for y
244  } // for x
245  } // for z
246 }
247 
248 
249 
250 
251 
253 {
254  Initialize(a_IniFile);
255 }
256 
257 
258 
259 
260 
262 {
263  int RelX = FloorC(a_X);
264  int RelY = 0;
265  int RelZ = FloorC(a_Z);
266  int ChunkX, ChunkZ;
267  cChunkDef::AbsoluteToRelative(RelX, RelY, RelZ, ChunkX, ChunkZ);
268 
269  // If we're within the same chunk, return the pre-cached heightmap:
270  if ((ChunkX == m_CurChunkCoords.m_ChunkX) && (ChunkZ == m_CurChunkCoords.m_ChunkZ))
271  {
272  return cChunkDef::GetHeight(m_CurChunkHeights, RelX, RelZ);
273  }
274 
275  // Ask the cache:
276  HEIGHTTYPE res = 0;
277  if (m_HeightGen.GetHeightAt(ChunkX, ChunkZ, RelX, RelZ, res))
278  {
279  // The height was in the cache
280  return res;
281  }
282 
283  // The height is not in the cache, generate full heightmap and get it there:
284  cChunkDef::HeightMap Heightmap;
285  m_HeightGen.GenHeightMap({ChunkX, ChunkZ}, Heightmap);
286  return cChunkDef::GetHeight(Heightmap, RelX, RelZ);
287 }
288 
289 
290 
291 
292 
294 {
295  BiomeNeighbors Biomes;
296  for (int z = -1; z <= 1; z++)
297  {
298  for (int x = -1; x <= 1; x++)
299  {
300  m_BiomeGen.GenBiomes({m_CurChunkCoords.m_ChunkX + x, m_CurChunkCoords.m_ChunkZ + z}, Biomes[x + 1][z + 1]);
301  } // for x
302  } // for z
303 
304  for (int z = 0; z < DIM_Z; z++)
305  {
306  for (int x = 0; x < DIM_Z; x++)
307  {
308  GetDistortAmpsAt(Biomes, x * INTERPOL_X, z * INTERPOL_Z, m_DistortAmpX[x + DIM_X * z], m_DistortAmpZ[x + DIM_X * z]);
309  }
310  }
311 }
312 
313 
314 
315 
316 
317 void cDistortedHeightmap::GetDistortAmpsAt(BiomeNeighbors & a_Neighbors, int a_RelX, int a_RelZ, NOISE_DATATYPE & a_DistortAmpX, NOISE_DATATYPE & a_DistortAmpZ)
318 {
319  // Sum up how many biomes of each type there are in the neighborhood:
320  int BiomeCounts[256];
321  memset(BiomeCounts, 0, sizeof(BiomeCounts));
322  int Sum = 0;
323  for (int z = -8; z <= 8; z++)
324  {
325  int FinalZ = a_RelZ + z + cChunkDef::Width;
326  int IdxZ = FinalZ / cChunkDef::Width;
327  int ModZ = FinalZ % cChunkDef::Width;
328  int WeightZ = 9 - abs(z);
329  for (int x = -8; x <= 8; x++)
330  {
331  int FinalX = a_RelX + x + cChunkDef::Width;
332  int IdxX = FinalX / cChunkDef::Width;
333  int ModX = FinalX % cChunkDef::Width;
334  EMCSBiome Biome = cChunkDef::GetBiome(a_Neighbors[IdxX][IdxZ], ModX, ModZ);
335  int WeightX = 9 - abs(x);
336  BiomeCounts[Biome] += WeightX + WeightZ;
337  Sum += WeightX + WeightZ;
338  } // for x
339  } // for z
340 
341  if (Sum <= 0)
342  {
343  // No known biome around? Weird. Return a bogus value:
344  ASSERT(!"cHeiGenBiomal: Biome sum failed, no known biome around");
345  a_DistortAmpX = 16;
346  a_DistortAmpZ = 16;
347  }
348 
349  // For each biome type that has a nonzero count, calc its amps and add it:
350  NOISE_DATATYPE AmpX = 0;
351  NOISE_DATATYPE AmpZ = 0;
352  for (size_t i = 0; i < ARRAYCOUNT(BiomeCounts); i++)
353  {
354  if (BiomeCounts[i] <= 0)
355  {
356  continue;
357  }
358 
359  /*
360  // Sanity checks for biome parameters, enable them to check the biome param table in runtime (slow):
361  ASSERT(m_GenParam[i].m_DistortAmpX >= 0);
362  ASSERT(m_GenParam[i].m_DistortAmpX < 100);
363  ASSERT(m_GenParam[i].m_DistortAmpX >= 0);
364  ASSERT(m_GenParam[i].m_DistortAmpX < 100);
365  */
366 
367  AmpX += BiomeCounts[i] * m_GenParam[i].m_DistortAmpX;
368  AmpZ += BiomeCounts[i] * m_GenParam[i].m_DistortAmpZ;
369  }
370  a_DistortAmpX = AmpX / Sum;
371  a_DistortAmpZ = AmpZ / Sum;
372 }
373 
374 
375 
376 
EMCSBiome
Biome IDs The first batch corresponds to the clientside biomes, used by MineCraft.
Definition: BiomeDef.h:18
unsigned char HEIGHTTYPE
The type used by the heightmap.
Definition: ChunkDef.h:47
#define ARRAYCOUNT(X)
Evaluates to the number of elements in an array (compile-time!)
Definition: Globals.h:231
#define ASSERT(x)
Definition: Globals.h:276
std::enable_if< std::is_arithmetic< T >::value, C >::type FloorC(T a_Value)
Floors a value, then casts it to C (an int by default).
Definition: Globals.h:347
void LinearUpscale3DArray(TYPE *a_Src, int a_SrcSizeX, int a_SrcSizeY, int a_SrcSizeZ, TYPE *a_Dst, int a_UpscaleX, int a_UpscaleY, int a_UpscaleZ)
Linearly interpolates values in the array between the equidistant anchor points (upscales).
float NOISE_DATATYPE
The datatype used by all the noise generators.
Definition: Noise.h:9
Wraps the chunk coords into a single structure.
Definition: ChunkDef.h:57
int m_ChunkZ
Definition: ChunkDef.h:60
int m_ChunkX
Definition: ChunkDef.h:59
static void AbsoluteToRelative(int &a_X, int &a_Y, int &a_Z, int &a_ChunkX, int &a_ChunkZ)
Converts absolute block coords into relative (chunk + block) coords:
Definition: ChunkDef.h:147
HEIGHTTYPE HeightMap[Width *Width]
The type used for any heightmap operations and storage; idx = x + Width * z; Height points to the hig...
Definition: ChunkDef.h:132
static const int Width
Definition: ChunkDef.h:124
static const int Height
Definition: ChunkDef.h:125
static HEIGHTTYPE GetHeight(const HeightMap &a_HeightMap, int a_X, int a_Z)
Definition: ChunkDef.h:303
static EMCSBiome GetBiome(const BiomeMap &a_BiomeMap, int a_X, int a_Z)
Definition: ChunkDef.h:319
Byte Shape[256 *16 *16]
The datatype used to represent the entire chunk worth of shape.
Definition: ChunkDesc.h:36
The interface that a biome generator must implement A biome generator takes chunk coords on input and...
virtual void GenBiomes(cChunkCoords a_ChunkCoords, cChunkDef::BiomeMap &a_BiomeMap)=0
Generates biomes for the given chunk.
NOISE_DATATYPE m_DistortAmpZ[DIM_X *DIM_Z]
cPerlinNoise m_NoiseDistortZ
virtual void GenShape(cChunkCoords a_ChunkCoords, cChunkDesc::Shape &a_Shape) override
Generates the shape for the given chunk.
NOISE_DATATYPE m_FrequencyX
static const int INTERPOL_Y
static const int DIM_X
static const int INTERPOL_X
cChunkCoords m_CurChunkCoords
cChunkDef::BiomeMap BiomeNeighbors[3][3]
static const int DIM_Z
NOISE_DATATYPE m_FrequencyZ
cChunkDef::HeightMap m_CurChunkHeights
Heightmap for the current chunk, before distortion (from m_HeightGen).
void Initialize(cIniFile &a_IniFile)
Reads the settings from the ini file.
static const int INTERPOL_Z
static const int DIM_Y
int GetHeightmapAt(NOISE_DATATYPE a_X, NOISE_DATATYPE a_Z)
Calculates the heightmap value (before distortion) at the specified (floating-point) coords.
cBiomeGen & m_BiomeGen
The bime generator to query for biomes.
cHeiGenCache m_HeightGen
Cache for m_UnderlyingHeiGen.
cPerlinNoise m_NoiseDistortX
void UpdateDistortAmps(void)
Updates m_DistortAmpX/Z[] based on m_CurChunkX and m_CurChunkZ.
void GetDistortAmpsAt(BiomeNeighbors &a_Neighbors, int a_RelX, int a_RelZ, NOISE_DATATYPE &a_DistortAmpX, NOISE_DATATYPE &a_DistortAmpZ)
Calculates the X and Z distortion amplitudes based on the neighbors' biomes.
NOISE_DATATYPE m_DistortedHeightmap[17 *257 *17]
NOISE_DATATYPE m_DistortAmpX[DIM_X *DIM_Z]
static const sGenParam m_GenParam[256]
This table assigns a relative maximum overhang size in each direction to biomes.
NOISE_DATATYPE m_FrequencyY
void PrepareState(cChunkCoords a_ChunkCoords)
Unless the LastChunk coords are equal to coords given, prepares the internal state (noise arrays,...
cDistortedHeightmap(int a_Seed, cBiomeGen &a_BiomeGen)
virtual void InitializeShapeGen(cIniFile &a_IniFile) override
Reads parameters from the ini file, prepares generator for use.
bool m_IsInitialized
True if Initialize() has been called.
void GenerateHeightArray(void)
Generates the m_DistortedHeightmap array for the current chunk.
virtual void GenHeightMap(cChunkCoords a_ChunkCoords, cChunkDef::HeightMap &a_HeightMap) override
Retrieves the heightmap for the specified chunk.
Definition: HeiGen.cpp:128
virtual HEIGHTTYPE GetHeightAt(int a_BlockX, int a_BlockZ) override
Returns the height at the specified column.
Definition: HeiGen.cpp:181
int GetValueSetI(const AString &keyname, const AString &valuename, const int defValue=0) override
Definition: IniFile.cpp:559
double GetValueSetF(const AString &keyname, const AString &valuename, const double defValue=0.0)
Definition: IniFile.cpp:549
void Generate3D(NOISE_DATATYPE *a_Array, int a_SizeX, int a_SizeY, int a_SizeZ, NOISE_DATATYPE a_StartX, NOISE_DATATYPE a_EndX, NOISE_DATATYPE a_StartY, NOISE_DATATYPE a_EndY, NOISE_DATATYPE a_StartZ, NOISE_DATATYPE a_EndZ, NOISE_DATATYPE *a_Workspace=nullptr) const
Fills a 3D array with the values of the noise.
Definition: OctavedNoise.h:104
void AddOctave(NOISE_DATATYPE a_Frequency, NOISE_DATATYPE a_Amplitude)
Adds a new octave to the list of octaves that compose this noise.
Definition: OctavedNoise.h:38