19 #define NOISE_SIZE_Y (257 + 32)
float NOISE_DATATYPE
The datatype used by all the noise generators.
Wraps the chunk coords into a single structure.
HEIGHTTYPE HeightMap[Width *Width]
The type used for any heightmap operations and storage; idx = x + Width * z; Height points to the hig...
EMCSBiome BiomeMap[Width *Width]
The type used for any biomemap operations and storage inside Cuberite, using Cuberite biomes (need no...
Byte Shape[256 *16 *16]
The datatype used to represent the entire chunk worth of shape.
The interface that a biome generator must implement A biome generator takes chunk coords on input and...
The interface that a terrain shape generator must implement A terrain shape generator takes chunk coo...
cHeiGenBiomal m_UnderlyingHeiGen
The generator that provides the base heightmap (before distortion).
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 INTERPOL_X
cChunkCoords m_CurChunkCoords
cChunkDef::BiomeMap BiomeNeighbors[3][3]
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
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.
NOISE_DATATYPE m_DistortAmpZ
NOISE_DATATYPE m_DistortAmpX
A simple cache that stores N most recently generated chunks' heightmaps; N being settable upon creati...