Cuberite
A lightweight, fast and extensible game server for Minecraft
|
#include <DistortedHeightmap.h>
Classes | |
struct | sGenParam |
Public Member Functions | |
cDistortedHeightmap (int a_Seed, cBiomeGen &a_BiomeGen) | |
Public Member Functions inherited from cTerrainShapeGen | |
virtual | ~cTerrainShapeGen () |
Protected Types | |
typedef cChunkDef::BiomeMap | BiomeNeighbors[3][3] |
Protected Member Functions | |
void | GenerateHeightArray (void) |
Generates the m_DistortedHeightmap array for the current chunk. More... | |
virtual void | GenShape (cChunkCoords a_ChunkCoords, cChunkDesc::Shape &a_Shape) override |
Generates the shape for the given chunk. More... | |
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. More... | |
int | GetHeightmapAt (NOISE_DATATYPE a_X, NOISE_DATATYPE a_Z) |
Calculates the heightmap value (before distortion) at the specified (floating-point) coords. More... | |
void | Initialize (cIniFile &a_IniFile) |
Reads the settings from the ini file. More... | |
virtual void | InitializeShapeGen (cIniFile &a_IniFile) override |
Reads parameters from the ini file, prepares generator for use. More... | |
void | PrepareState (cChunkCoords a_ChunkCoords) |
Unless the LastChunk coords are equal to coords given, prepares the internal state (noise arrays, heightmap). More... | |
void | UpdateDistortAmps (void) |
Updates m_DistortAmpX/Z[] based on m_CurChunkX and m_CurChunkZ. More... | |
Protected Attributes | |
cBiomeGen & | m_BiomeGen |
The bime generator to query for biomes. More... | |
cChunkCoords | m_CurChunkCoords |
cChunkDef::HeightMap | m_CurChunkHeights |
Heightmap for the current chunk, before distortion (from m_HeightGen). More... | |
NOISE_DATATYPE | m_DistortAmpX [DIM_X *DIM_Z] |
NOISE_DATATYPE | m_DistortAmpZ [DIM_X *DIM_Z] |
NOISE_DATATYPE | m_DistortedHeightmap [17 *257 *17] |
NOISE_DATATYPE | m_FrequencyX |
NOISE_DATATYPE | m_FrequencyY |
NOISE_DATATYPE | m_FrequencyZ |
cHeiGenCache | m_HeightGen |
Cache for m_UnderlyingHeiGen. More... | |
bool | m_IsInitialized |
True if Initialize() has been called. More... | |
cPerlinNoise | m_NoiseDistortX |
cPerlinNoise | m_NoiseDistortZ |
int | m_SeaLevel |
cHeiGenBiomal | m_UnderlyingHeiGen |
The generator that provides the base heightmap (before distortion). More... | |
Static Protected Attributes | |
static const int | DIM_X = 1 + (17 / INTERPOL_X) |
static const int | DIM_Y = 1 + (257 / INTERPOL_Y) |
static const int | DIM_Z = 1 + (17 / INTERPOL_Z) |
static const int | INTERPOL_X = 8 |
static const int | INTERPOL_Y = 4 |
static const int | INTERPOL_Z = 8 |
static const sGenParam | m_GenParam [256] |
This table assigns a relative maximum overhang size in each direction to biomes. More... | |
Additional Inherited Members | |
Static Public Member Functions inherited from cTerrainShapeGen | |
static std::unique_ptr< cTerrainShapeGen > | CreateShapeGen (cIniFile &a_IniFile, cBiomeGen &a_BiomeGen, int a_Seed, bool &a_CacheOffByDefault) |
Creates the correct TerrainShapeGen descendant based on the ini file settings and the seed provided. More... | |
Definition at line 25 of file DistortedHeightmap.h.
|
protected |
Definition at line 32 of file DistortedHeightmap.h.
cDistortedHeightmap::cDistortedHeightmap | ( | int | a_Seed, |
cBiomeGen & | a_BiomeGen | ||
) |
Definition at line 121 of file DistortedHeightmap.cpp.
|
protected |
Generates the m_DistortedHeightmap array for the current chunk.
Definition at line 181 of file DistortedHeightmap.cpp.
|
overrideprotectedvirtual |
Generates the shape for the given chunk.
Implements cTerrainShapeGen.
Definition at line 232 of file DistortedHeightmap.cpp.
|
protected |
Calculates the X and Z distortion amplitudes based on the neighbors' biomes.
Definition at line 317 of file DistortedHeightmap.cpp.
|
protected |
Calculates the heightmap value (before distortion) at the specified (floating-point) coords.
Definition at line 261 of file DistortedHeightmap.cpp.
|
protected |
Reads the settings from the ini file.
Skips reading if already initialized.
Definition at line 143 of file DistortedHeightmap.cpp.
|
overrideprotectedvirtual |
Reads parameters from the ini file, prepares generator for use.
Reimplemented from cTerrainShapeGen.
Definition at line 252 of file DistortedHeightmap.cpp.
|
protected |
Unless the LastChunk coords are equal to coords given, prepares the internal state (noise arrays, heightmap).
Definition at line 163 of file DistortedHeightmap.cpp.
|
protected |
Updates m_DistortAmpX/Z[] based on m_CurChunkX and m_CurChunkZ.
Definition at line 293 of file DistortedHeightmap.cpp.
|
staticprotected |
Definition at line 40 of file DistortedHeightmap.h.
|
staticprotected |
Definition at line 41 of file DistortedHeightmap.h.
|
staticprotected |
Definition at line 42 of file DistortedHeightmap.h.
|
staticprotected |
Definition at line 35 of file DistortedHeightmap.h.
|
staticprotected |
Definition at line 36 of file DistortedHeightmap.h.
|
staticprotected |
Definition at line 37 of file DistortedHeightmap.h.
|
protected |
The bime generator to query for biomes.
Definition at line 56 of file DistortedHeightmap.h.
|
protected |
Definition at line 52 of file DistortedHeightmap.h.
|
protected |
Heightmap for the current chunk, before distortion (from m_HeightGen).
Used for optimization.
Definition at line 65 of file DistortedHeightmap.h.
|
protected |
Definition at line 76 of file DistortedHeightmap.h.
|
protected |
Definition at line 77 of file DistortedHeightmap.h.
|
protected |
Definition at line 53 of file DistortedHeightmap.h.
|
protected |
Definition at line 48 of file DistortedHeightmap.h.
|
protected |
Definition at line 49 of file DistortedHeightmap.h.
|
protected |
Definition at line 50 of file DistortedHeightmap.h.
|
staticprotected |
This table assigns a relative maximum overhang size in each direction to biomes.
Both numbers indicate a number which will multiply the noise value for each coord; this means that you can have different-sized overhangs in each direction. Usually you'd want to keep both numbers the same. The numbers are "relative", not absolute maximum; overhangs of a slightly larger size are possible due to the way that noise is calculated.
Definition at line 73 of file DistortedHeightmap.h.
|
protected |
Cache for m_UnderlyingHeiGen.
Definition at line 62 of file DistortedHeightmap.h.
|
protected |
True if Initialize() has been called.
Used to initialize-once even with multiple init entrypoints (HeiGen / CompoGen).
Definition at line 80 of file DistortedHeightmap.h.
|
protected |
Definition at line 44 of file DistortedHeightmap.h.
|
protected |
Definition at line 45 of file DistortedHeightmap.h.
|
protected |
Definition at line 47 of file DistortedHeightmap.h.
|
protected |
The generator that provides the base heightmap (before distortion).
Definition at line 59 of file DistortedHeightmap.h.