Cuberite
A lightweight, fast and extensible game server for Minecraft
Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes | Static Protected Attributes | List of all members
cBiomalNoise3DComposable Class Reference

#include <Noise3DGenerator.h>

Inheritance diagram for cBiomalNoise3DComposable:
Inheritance graph
[legend]
Collaboration diagram for cBiomalNoise3DComposable:
Collaboration graph
[legend]

Public Member Functions

 cBiomalNoise3DComposable (int a_Seed, cBiomeGen &a_BiomeGen)
 
void Initialize (cIniFile &a_IniFile)
 
- Public Member Functions inherited from cTerrainShapeGen
virtual ~cTerrainShapeGen ()
 

Protected Types

typedef NOISE_DATATYPE ChunkParam[5 *5]
 Type used for a single parameter across the entire (downscaled) chunk. More...
 

Protected Member Functions

void CalcBiomeParamArrays (cChunkCoords a_ChunkCoords, ChunkParam &a_HeightAmp, ChunkParam &a_MidPoint)
 Calculates the biome-related parameters for the chunk. More...
 
void GenerateNoiseArrayIfNeeded (cChunkCoords a_ChunkCoords)
 Generates the 3D noise array used for terrain generation (m_NoiseArray), unless the LastChunk coords are equal to coords given. More...
 
virtual void GenShape (cChunkCoords a_ChunkCoords, cChunkDesc::Shape &a_Shape) override
 Generates the shape for the given chunk. More...
 
void GetBiomeParams (EMCSBiome a_Biome, NOISE_DATATYPE &a_HeightAmp, NOISE_DATATYPE &a_MidPoint)
 Returns the parameters for the specified biome. More...
 
virtual void InitializeShapeGen (cIniFile &a_IniFile) override
 Reads parameters from the ini file, prepares generator for use. More...
 

Protected Attributes

NOISE_DATATYPE m_AirThreshold
 
NOISE_DATATYPE m_BaseFrequencyX
 
NOISE_DATATYPE m_BaseFrequencyZ
 
cOctavedNoise< cInterpolNoise< Interp5Deg > > m_BaseNoise
 Heightmap-like noise used to provide variance for low-amplitude biomes. More...
 
cBiomeGenm_BiomeGen
 The underlying biome generator. More...
 
NOISE_DATATYPE m_ChoiceFrequencyX
 
NOISE_DATATYPE m_ChoiceFrequencyY
 
NOISE_DATATYPE m_ChoiceFrequencyZ
 
cOctavedNoise< cInterpolNoise< Interp5Deg > > m_ChoiceNoise
 The noise that is used to choose between density noise A and B. More...
 
cOctavedNoise< cInterpolNoise< Interp5Deg > > m_DensityNoiseA
 Density 3D noise, variant A. More...
 
cOctavedNoise< cInterpolNoise< Interp5Deg > > m_DensityNoiseB
 Density 3D noise, variant B. More...
 
NOISE_DATATYPE m_FrequencyX
 
NOISE_DATATYPE m_FrequencyY
 
NOISE_DATATYPE m_FrequencyZ
 
cChunkCoords m_LastChunkCoords
 
NOISE_DATATYPE m_NoiseArray [17 *17 *257]
 
int m_SeaLevel
 Block height of the sealevel, used for composing the terrain. More...
 
NOISE_DATATYPE m_Weight [AVERAGING_SIZE *2+1][AVERAGING_SIZE *2+1]
 Weights for summing up neighboring biomes. More...
 
NOISE_DATATYPE m_WeightSum
 The sum of m_Weight[]. More...
 

Static Protected Attributes

static const int AVERAGING_SIZE = 9
 Number of columns around the pixel to query for biomes for averaging. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from cTerrainShapeGen
static std::unique_ptr< cTerrainShapeGenCreateShapeGen (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...
 

Detailed Description

Definition at line 135 of file Noise3DGenerator.h.

Member Typedef Documentation

◆ ChunkParam

typedef NOISE_DATATYPE cBiomalNoise3DComposable::ChunkParam[5 *5]
protected

Type used for a single parameter across the entire (downscaled) chunk.

Definition at line 148 of file Noise3DGenerator.h.

Constructor & Destructor Documentation

◆ cBiomalNoise3DComposable()

cBiomalNoise3DComposable::cBiomalNoise3DComposable ( int  a_Seed,
cBiomeGen a_BiomeGen 
)

Definition at line 509 of file Noise3DGenerator.cpp.

Member Function Documentation

◆ CalcBiomeParamArrays()

void cBiomalNoise3DComposable::CalcBiomeParamArrays ( cChunkCoords  a_ChunkCoords,
ChunkParam a_HeightAmp,
ChunkParam a_MidPoint 
)
protected

Calculates the biome-related parameters for the chunk.

Definition at line 649 of file Noise3DGenerator.cpp.

◆ GenerateNoiseArrayIfNeeded()

void cBiomalNoise3DComposable::GenerateNoiseArrayIfNeeded ( cChunkCoords  a_ChunkCoords)
protected

Generates the 3D noise array used for terrain generation (m_NoiseArray), unless the LastChunk coords are equal to coords given.

Definition at line 585 of file Noise3DGenerator.cpp.

◆ GenShape()

void cBiomalNoise3DComposable::GenShape ( cChunkCoords  a_ChunkCoords,
cChunkDesc::Shape a_Shape 
)
overrideprotectedvirtual

Generates the shape for the given chunk.

Implements cTerrainShapeGen.

Definition at line 778 of file Noise3DGenerator.cpp.

◆ GetBiomeParams()

void cBiomalNoise3DComposable::GetBiomeParams ( EMCSBiome  a_Biome,
NOISE_DATATYPE a_HeightAmp,
NOISE_DATATYPE a_MidPoint 
)
protected

Returns the parameters for the specified biome.

Definition at line 696 of file Noise3DGenerator.cpp.

◆ Initialize()

void cBiomalNoise3DComposable::Initialize ( cIniFile a_IniFile)

Definition at line 533 of file Noise3DGenerator.cpp.

◆ InitializeShapeGen()

virtual void cBiomalNoise3DComposable::InitializeShapeGen ( cIniFile a_IniFile)
inlineoverrideprotectedvirtual

Reads parameters from the ini file, prepares generator for use.

Reimplemented from cTerrainShapeGen.

Definition at line 208 of file Noise3DGenerator.h.

Member Data Documentation

◆ AVERAGING_SIZE

const int cBiomalNoise3DComposable::AVERAGING_SIZE = 9
staticprotected

Number of columns around the pixel to query for biomes for averaging.

Must be less than or equal to 16.

Definition at line 145 of file Noise3DGenerator.h.

◆ m_AirThreshold

NOISE_DATATYPE cBiomalNoise3DComposable::m_AirThreshold
protected

Definition at line 184 of file Noise3DGenerator.h.

◆ m_BaseFrequencyX

NOISE_DATATYPE cBiomalNoise3DComposable::m_BaseFrequencyX
protected

Definition at line 175 of file Noise3DGenerator.h.

◆ m_BaseFrequencyZ

NOISE_DATATYPE cBiomalNoise3DComposable::m_BaseFrequencyZ
protected

Definition at line 176 of file Noise3DGenerator.h.

◆ m_BaseNoise

cOctavedNoise<cInterpolNoise<Interp5Deg> > cBiomalNoise3DComposable::m_BaseNoise
protected

Heightmap-like noise used to provide variance for low-amplitude biomes.

Definition at line 161 of file Noise3DGenerator.h.

◆ m_BiomeGen

cBiomeGen& cBiomalNoise3DComposable::m_BiomeGen
protected

The underlying biome generator.

Definition at line 164 of file Noise3DGenerator.h.

◆ m_ChoiceFrequencyX

NOISE_DATATYPE cBiomalNoise3DComposable::m_ChoiceFrequencyX
protected

Definition at line 179 of file Noise3DGenerator.h.

◆ m_ChoiceFrequencyY

NOISE_DATATYPE cBiomalNoise3DComposable::m_ChoiceFrequencyY
protected

Definition at line 180 of file Noise3DGenerator.h.

◆ m_ChoiceFrequencyZ

NOISE_DATATYPE cBiomalNoise3DComposable::m_ChoiceFrequencyZ
protected

Definition at line 181 of file Noise3DGenerator.h.

◆ m_ChoiceNoise

cOctavedNoise<cInterpolNoise<Interp5Deg> > cBiomalNoise3DComposable::m_ChoiceNoise
protected

The noise that is used to choose between density noise A and B.

Definition at line 152 of file Noise3DGenerator.h.

◆ m_DensityNoiseA

cOctavedNoise<cInterpolNoise<Interp5Deg> > cBiomalNoise3DComposable::m_DensityNoiseA
protected

Density 3D noise, variant A.

Definition at line 155 of file Noise3DGenerator.h.

◆ m_DensityNoiseB

cOctavedNoise<cInterpolNoise<Interp5Deg> > cBiomalNoise3DComposable::m_DensityNoiseB
protected

Density 3D noise, variant B.

Definition at line 158 of file Noise3DGenerator.h.

◆ m_FrequencyX

NOISE_DATATYPE cBiomalNoise3DComposable::m_FrequencyX
protected

Definition at line 170 of file Noise3DGenerator.h.

◆ m_FrequencyY

NOISE_DATATYPE cBiomalNoise3DComposable::m_FrequencyY
protected

Definition at line 171 of file Noise3DGenerator.h.

◆ m_FrequencyZ

NOISE_DATATYPE cBiomalNoise3DComposable::m_FrequencyZ
protected

Definition at line 172 of file Noise3DGenerator.h.

◆ m_LastChunkCoords

cChunkCoords cBiomalNoise3DComposable::m_LastChunkCoords
protected

Definition at line 187 of file Noise3DGenerator.h.

◆ m_NoiseArray

NOISE_DATATYPE cBiomalNoise3DComposable::m_NoiseArray[17 *17 *257]
protected

Definition at line 188 of file Noise3DGenerator.h.

◆ m_SeaLevel

int cBiomalNoise3DComposable::m_SeaLevel
protected

Block height of the sealevel, used for composing the terrain.

Definition at line 167 of file Noise3DGenerator.h.

◆ m_Weight

NOISE_DATATYPE cBiomalNoise3DComposable::m_Weight[AVERAGING_SIZE *2+1][AVERAGING_SIZE *2+1]
protected

Weights for summing up neighboring biomes.

Definition at line 191 of file Noise3DGenerator.h.

◆ m_WeightSum

NOISE_DATATYPE cBiomalNoise3DComposable::m_WeightSum
protected

The sum of m_Weight[].

Definition at line 194 of file Noise3DGenerator.h.


The documentation for this class was generated from the following files: