16 #include "../Noise/Noise.h"
17 #include "../Noise/InterpolNoise.h"
EMCSBiome
Biome IDs The first batch corresponds to the clientside biomes, used by MineCraft.
float NOISE_DATATYPE
The datatype used by all the noise generators.
Wraps the chunk coords into a single structure.
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 all chunk generators must implement to provide the generated chunks.
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...
cOctavedNoise< cInterp5DegNoise > m_Perlin
The base 3D noise source for the actual composition.
void ComposeTerrain(cChunkDesc &a_ChunkDesc)
Composes terrain - adds dirt, grass and sand.
NOISE_DATATYPE m_FrequencyZ
void GenerateNoiseArray(cChunkCoords a_ChunkCoords, NOISE_DATATYPE *a_Noise)
Generates the 3D noise array used for terrain generation into a_Noise; a_Noise is of ChunkData-size.
cOctavedNoise< cInterp5DegNoise > m_Cubic
The noise used for heightmap directing.
NOISE_DATATYPE m_FrequencyY
virtual void Initialize(cIniFile &a_IniFile) override
Called to initialize the generator on server startup.
virtual void Generate(cChunkDesc &a_ChunkDesc) override
Does the actual chunk generation.
NOISE_DATATYPE m_MidPoint
static const int UPSCALE_X
virtual void GenerateBiomes(cChunkCoords a_ChunkCoords, cChunkDef::BiomeMap &a_BiomeMap) override
Generates the biomes for the specified chunk.
NOISE_DATATYPE m_FrequencyX
virtual ~cNoise3DGenerator() override
NOISE_DATATYPE m_AirThreshold
NOISE_DATATYPE m_HeightAmplification
static const int UPSCALE_Z
static const int UPSCALE_Y
NOISE_DATATYPE m_ChoiceFrequencyX
NOISE_DATATYPE m_FrequencyY
NOISE_DATATYPE m_ChoiceFrequencyY
cOctavedNoise< cInterpolNoise< Interp5Deg > > m_DensityNoiseA
Density 3D noise, variant A.
NOISE_DATATYPE m_FrequencyZ
NOISE_DATATYPE m_BaseFrequencyX
virtual void GenShape(cChunkCoords a_ChunkCoords, cChunkDesc::Shape &a_Shape) override
Generates the shape for the given chunk.
cOctavedNoise< cInterpolNoise< Interp5Deg > > m_BaseNoise
Heightmap-like noise used to provide variance for low-amplitude biomes.
NOISE_DATATYPE m_MidPoint
Where the vertical "center" of the noise should be, as block height.
NOISE_DATATYPE m_NoiseArray[17 *17 *257]
cChunkCoords m_LastChunkCoords
cOctavedNoise< cInterpolNoise< Interp5Deg > > m_DensityNoiseB
Density 3D noise, variant B.
cOctavedNoise< cInterpolNoise< Interp5Deg > > m_ChoiceNoise
The 3D noise that is used to choose between density noise A and B.
virtual void InitializeShapeGen(cIniFile &a_IniFile) override
Reads parameters from the ini file, prepares generator for use.
NOISE_DATATYPE m_FrequencyX
NOISE_DATATYPE m_HeightAmplification
The main parameter of the generator, specifies the slope of the vertical linear gradient.
NOISE_DATATYPE m_BaseFrequencyZ
NOISE_DATATYPE m_AirThreshold
NOISE_DATATYPE m_ChoiceFrequencyZ
cNoise3DComposable(int a_Seed)
void GenerateNoiseArrayIfNeeded(cChunkCoords a_ChunkCoords)
Generates the 3D noise array used for terrain generation (m_NoiseArray), unless the LastChunk coords ...
void Initialize(cIniFile &a_IniFile)
NOISE_DATATYPE m_ChoiceFrequencyY
NOISE_DATATYPE m_ChoiceFrequencyZ
NOISE_DATATYPE m_Weight[AVERAGING_SIZE *2+1][AVERAGING_SIZE *2+1]
Weights for summing up neighboring biomes.
NOISE_DATATYPE m_NoiseArray[17 *17 *257]
void CalcBiomeParamArrays(cChunkCoords a_ChunkCoords, ChunkParam &a_HeightAmp, ChunkParam &a_MidPoint)
Calculates the biome-related parameters for the chunk.
cOctavedNoise< cInterpolNoise< Interp5Deg > > m_BaseNoise
Heightmap-like noise used to provide variance for low-amplitude biomes.
NOISE_DATATYPE m_WeightSum
The sum of m_Weight[].
void GenerateNoiseArrayIfNeeded(cChunkCoords a_ChunkCoords)
Generates the 3D noise array used for terrain generation (m_NoiseArray), unless the LastChunk coords ...
cOctavedNoise< cInterpolNoise< Interp5Deg > > m_ChoiceNoise
The noise that is used to choose between density noise A and B.
cBiomeGen & m_BiomeGen
The underlying biome generator.
cOctavedNoise< cInterpolNoise< Interp5Deg > > m_DensityNoiseA
Density 3D noise, variant A.
NOISE_DATATYPE m_FrequencyY
NOISE_DATATYPE m_FrequencyX
void Initialize(cIniFile &a_IniFile)
cBiomalNoise3DComposable(int a_Seed, cBiomeGen &a_BiomeGen)
int m_SeaLevel
Block height of the sealevel, used for composing the terrain.
NOISE_DATATYPE m_ChoiceFrequencyX
NOISE_DATATYPE m_AirThreshold
static const int AVERAGING_SIZE
Number of columns around the pixel to query for biomes for averaging.
cChunkCoords m_LastChunkCoords
NOISE_DATATYPE ChunkParam[5 *5]
Type used for a single parameter across the entire (downscaled) chunk.
void GetBiomeParams(EMCSBiome a_Biome, NOISE_DATATYPE &a_HeightAmp, NOISE_DATATYPE &a_MidPoint)
Returns the parameters for the specified biome.
cOctavedNoise< cInterpolNoise< Interp5Deg > > m_DensityNoiseB
Density 3D noise, variant B.
virtual void InitializeShapeGen(cIniFile &a_IniFile) override
Reads parameters from the ini file, prepares generator for use.
NOISE_DATATYPE m_BaseFrequencyZ
virtual void GenShape(cChunkCoords a_ChunkCoords, cChunkDesc::Shape &a_Shape) override
Generates the shape for the given chunk.
NOISE_DATATYPE m_FrequencyZ
NOISE_DATATYPE m_BaseFrequencyX