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

#include <Noise3DGenerator.h>

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

Public Member Functions

 cNoise3DGenerator ()
 
virtual void Generate (cChunkDesc &a_ChunkDesc) override
 Does the actual chunk generation. More...
 
virtual void GenerateBiomes (cChunkCoords a_ChunkCoords, cChunkDef::BiomeMap &a_BiomeMap) override
 Generates the biomes for the specified chunk. More...
 
virtual void Initialize (cIniFile &a_IniFile) override
 Called to initialize the generator on server startup. More...
 
virtual ~cNoise3DGenerator () override
 
- Public Member Functions inherited from cChunkGenerator
virtual EMCSBiome GetBiomeAt (int a_BlockX, int a_BlockZ)
 Returns the biome at the specified coords. More...
 
int GetSeed (void) const
 Returns the seed that was read from the INI file. More...
 
virtual ~cChunkGenerator ()
 

Protected Member Functions

void ComposeTerrain (cChunkDesc &a_ChunkDesc)
 Composes terrain - adds dirt, grass and sand. More...
 
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. More...
 

Protected Attributes

NOISE_DATATYPE m_AirThreshold
 
cOctavedNoise< cInterp5DegNoisem_Cubic
 The noise used for heightmap directing. More...
 
NOISE_DATATYPE m_FrequencyX
 
NOISE_DATATYPE m_FrequencyY
 
NOISE_DATATYPE m_FrequencyZ
 
NOISE_DATATYPE m_HeightAmplification
 
NOISE_DATATYPE m_MidPoint
 
cOctavedNoise< cInterp5DegNoisem_Perlin
 The base 3D noise source for the actual composition. More...
 
int m_SeaLevel
 
- Protected Attributes inherited from cChunkGenerator
eDimension m_Dimension
 The dimension, read from the INI file. More...
 
int m_Seed
 The main seed, read from the INI file, used for the entire generator. More...
 

Static Protected Attributes

static const int DIM_X = 1 + cChunkDef::Width / UPSCALE_X
 
static const int DIM_Y = 1 + cChunkDef::Height / UPSCALE_Y
 
static const int DIM_Z = 1 + cChunkDef::Width / UPSCALE_Z
 
static const int UPSCALE_X = 4
 
static const int UPSCALE_Y = 8
 
static const int UPSCALE_Z = 4
 

Private Types

using Super = cChunkGenerator
 

Additional Inherited Members

- Static Public Member Functions inherited from cChunkGenerator
static std::unique_ptr< cChunkGeneratorCreateFromIniFile (cIniFile &a_IniFile)
 Creates and initializes the entire generator based on the settings in the INI file. More...
 

Detailed Description

Definition at line 23 of file Noise3DGenerator.h.

Member Typedef Documentation

◆ Super

Definition at line 26 of file Noise3DGenerator.h.

Constructor & Destructor Documentation

◆ cNoise3DGenerator()

cNoise3DGenerator::cNoise3DGenerator ( )

Definition at line 151 of file Noise3DGenerator.cpp.

◆ ~cNoise3DGenerator()

cNoise3DGenerator::~cNoise3DGenerator ( )
overridevirtual

Definition at line 173 of file Noise3DGenerator.cpp.

Member Function Documentation

◆ ComposeTerrain()

void cNoise3DGenerator::ComposeTerrain ( cChunkDesc a_ChunkDesc)
protected

Composes terrain - adds dirt, grass and sand.

Definition at line 296 of file Noise3DGenerator.cpp.

◆ Generate()

void cNoise3DGenerator::Generate ( cChunkDesc a_ChunkDesc)
overridevirtual

Does the actual chunk generation.

Descendants need to override this and generate into a_ChunkDesc.

Implements cChunkGenerator.

Definition at line 211 of file Noise3DGenerator.cpp.

◆ GenerateBiomes()

void cNoise3DGenerator::GenerateBiomes ( cChunkCoords  a_ChunkCoords,
cChunkDef::BiomeMap a_BiomeMap 
)
overridevirtual

Generates the biomes for the specified chunk.

Used by the world loader if biomes failed loading.

Implements cChunkGenerator.

Definition at line 198 of file Noise3DGenerator.cpp.

◆ GenerateNoiseArray()

void cNoise3DGenerator::GenerateNoiseArray ( cChunkCoords  a_ChunkCoords,
NOISE_DATATYPE a_Noise 
)
protected

Generates the 3D noise array used for terrain generation into a_Noise; a_Noise is of ChunkData-size.

Definition at line 247 of file Noise3DGenerator.cpp.

◆ Initialize()

void cNoise3DGenerator::Initialize ( cIniFile a_IniFile)
overridevirtual

Called to initialize the generator on server startup.

Descendants should call Super::Initialize() before initializing themselves.

Reimplemented from cChunkGenerator.

Definition at line 182 of file Noise3DGenerator.cpp.

Member Data Documentation

◆ DIM_X

const int cNoise3DGenerator::DIM_X = 1 + cChunkDef::Width / UPSCALE_X
staticprotected

Definition at line 44 of file Noise3DGenerator.h.

◆ DIM_Y

const int cNoise3DGenerator::DIM_Y = 1 + cChunkDef::Height / UPSCALE_Y
staticprotected

Definition at line 45 of file Noise3DGenerator.h.

◆ DIM_Z

const int cNoise3DGenerator::DIM_Z = 1 + cChunkDef::Width / UPSCALE_Z
staticprotected

Definition at line 46 of file Noise3DGenerator.h.

◆ m_AirThreshold

NOISE_DATATYPE cNoise3DGenerator::m_AirThreshold
protected

Definition at line 60 of file Noise3DGenerator.h.

◆ m_Cubic

cOctavedNoise<cInterp5DegNoise> cNoise3DGenerator::m_Cubic
protected

The noise used for heightmap directing.

Definition at line 52 of file Noise3DGenerator.h.

◆ m_FrequencyX

NOISE_DATATYPE cNoise3DGenerator::m_FrequencyX
protected

Definition at line 57 of file Noise3DGenerator.h.

◆ m_FrequencyY

NOISE_DATATYPE cNoise3DGenerator::m_FrequencyY
protected

Definition at line 58 of file Noise3DGenerator.h.

◆ m_FrequencyZ

NOISE_DATATYPE cNoise3DGenerator::m_FrequencyZ
protected

Definition at line 59 of file Noise3DGenerator.h.

◆ m_HeightAmplification

NOISE_DATATYPE cNoise3DGenerator::m_HeightAmplification
protected

Definition at line 55 of file Noise3DGenerator.h.

◆ m_MidPoint

NOISE_DATATYPE cNoise3DGenerator::m_MidPoint
protected

Definition at line 56 of file Noise3DGenerator.h.

◆ m_Perlin

cOctavedNoise<cInterp5DegNoise> cNoise3DGenerator::m_Perlin
protected

The base 3D noise source for the actual composition.

Definition at line 49 of file Noise3DGenerator.h.

◆ m_SeaLevel

int cNoise3DGenerator::m_SeaLevel
protected

Definition at line 54 of file Noise3DGenerator.h.

◆ UPSCALE_X

const int cNoise3DGenerator::UPSCALE_X = 4
staticprotected

Definition at line 39 of file Noise3DGenerator.h.

◆ UPSCALE_Y

const int cNoise3DGenerator::UPSCALE_Y = 8
staticprotected

Definition at line 40 of file Noise3DGenerator.h.

◆ UPSCALE_Z

const int cNoise3DGenerator::UPSCALE_Z = 4
staticprotected

Definition at line 41 of file Noise3DGenerator.h.


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