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

#include <BioGen.h>

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

Public Member Functions

 cBioGenMultiStepMap (int a_Seed)
 
- Public Member Functions inherited from cBiomeGen
virtual ~cBiomeGen ()
 

Protected Types

typedef double DblMap[17 *17]
 
typedef int IntMap[17 *17]
 

Protected Member Functions

void AddRivers (cChunkCoords a_ChunkCoords, cChunkDef::BiomeMap &a_BiomeMap)
 Step 2: Add rivers to the land Flips some "-1" biomes into biRiver. More...
 
void ApplyTemperatureHumidity (cChunkCoords a_ChunkCoords, cChunkDef::BiomeMap &a_BiomeMap)
 Step 3: Decide land biomes using a temperature / humidity map; freeze ocean / river in low temperatures. More...
 
void BuildTemperatureHumidityMaps (cChunkCoords a_ChunkCoords, IntMap &a_TemperatureMap, IntMap &a_HumidityMap)
 Builds two Perlin-noise maps, one for temperature, the other for humidity. More...
 
void DecideLandBiomes (cChunkDef::BiomeMap &a_BiomeMap, const IntMap &a_TemperatureMap, const IntMap &a_HumidityMap)
 Flips all remaining "-1" biomes into land biomes using the two maps. More...
 
void DecideOceanLandMushroom (cChunkCoords a_ChunkCoords, cChunkDef::BiomeMap &a_BiomeMap)
 Step 1: Decides between ocean, land and mushroom, using a DistVoronoi with special conditions and post-processing for mushroom islands Sets biomes to biOcean, -1 (i.e. More...
 
void Distort (int a_BlockX, int a_BlockZ, int &a_DistortedX, int &a_DistortedZ, int a_CellSize)
 Distorts the coords using a Perlin-like noise, with a specified cell-size. More...
 
void FreezeWaterBiomes (cChunkDef::BiomeMap &a_BiomeMap, const IntMap &a_TemperatureMap)
 Flips biOcean and biRiver into biFrozenOcean and biFrozenRiver if the temperature is too low. More...
 
virtual void GenBiomes (cChunkCoords a_ChunkCoords, cChunkDef::BiomeMap &a_BiomeMap) override
 Generates biomes for the given chunk. More...
 
virtual void InitializeBiomeGen (cIniFile &a_IniFile) override
 Reads parameters from the ini file, prepares generator for use. More...
 

Protected Attributes

float m_LandBiomesSize
 
int m_MushroomIslandSize
 
cNoise m_Noise1
 
cNoise m_Noise2
 
cNoise m_Noise3
 
cNoise m_Noise4
 
cNoise m_Noise5
 
cNoise m_Noise6
 
int m_OceanCellSize
 
int m_RiverCellSize
 
double m_RiverWidthThreshold
 
int m_Seed
 

Private Types

using Super = cBiomeGen
 

Additional Inherited Members

- Static Public Member Functions inherited from cBiomeGen
static std::unique_ptr< cBiomeGenCreateBiomeGen (cIniFile &a_IniFile, int a_Seed, bool &a_CacheOffByDefault)
 Creates the correct BiomeGen descendant based on the ini file settings. More...
 

Detailed Description

Definition at line 224 of file BioGen.h.

Member Typedef Documentation

◆ DblMap

typedef double cBioGenMultiStepMap::DblMap[17 *17]
protected

Definition at line 250 of file BioGen.h.

◆ IntMap

typedef int cBioGenMultiStepMap::IntMap[17 *17]
protected

Definition at line 249 of file BioGen.h.

◆ Super

Definition at line 227 of file BioGen.h.

Constructor & Destructor Documentation

◆ cBioGenMultiStepMap()

cBioGenMultiStepMap::cBioGenMultiStepMap ( int  a_Seed)

Definition at line 397 of file BioGen.cpp.

Member Function Documentation

◆ AddRivers()

void cBioGenMultiStepMap::AddRivers ( cChunkCoords  a_ChunkCoords,
cChunkDef::BiomeMap a_BiomeMap 
)
protected

Step 2: Add rivers to the land Flips some "-1" biomes into biRiver.

Definition at line 544 of file BioGen.cpp.

◆ ApplyTemperatureHumidity()

void cBioGenMultiStepMap::ApplyTemperatureHumidity ( cChunkCoords  a_ChunkCoords,
cChunkDef::BiomeMap a_BiomeMap 
)
protected

Step 3: Decide land biomes using a temperature / humidity map; freeze ocean / river in low temperatures.

Flips all remaining "-1" biomes into land biomes. Also flips some biOcean and biRiver into biFrozenOcean, biFrozenRiver, based on temp map.

Definition at line 575 of file BioGen.cpp.

◆ BuildTemperatureHumidityMaps()

void cBioGenMultiStepMap::BuildTemperatureHumidityMaps ( cChunkCoords  a_ChunkCoords,
IntMap a_TemperatureMap,
IntMap a_HumidityMap 
)
protected

Builds two Perlin-noise maps, one for temperature, the other for humidity.

Trims both into [0..255] range

Definition at line 606 of file BioGen.cpp.

◆ DecideLandBiomes()

void cBioGenMultiStepMap::DecideLandBiomes ( cChunkDef::BiomeMap a_BiomeMap,
const IntMap a_TemperatureMap,
const IntMap a_HumidityMap 
)
protected

Flips all remaining "-1" biomes into land biomes using the two maps.

Definition at line 644 of file BioGen.cpp.

◆ DecideOceanLandMushroom()

void cBioGenMultiStepMap::DecideOceanLandMushroom ( cChunkCoords  a_ChunkCoords,
cChunkDef::BiomeMap a_BiomeMap 
)
protected

Step 1: Decides between ocean, land and mushroom, using a DistVoronoi with special conditions and post-processing for mushroom islands Sets biomes to biOcean, -1 (i.e.

land), biMushroomIsland or biMushroomShore.

Definition at line 441 of file BioGen.cpp.

◆ Distort()

void cBioGenMultiStepMap::Distort ( int  a_BlockX,
int  a_BlockZ,
int &  a_DistortedX,
int &  a_DistortedZ,
int  a_CellSize 
)
protected

Distorts the coords using a Perlin-like noise, with a specified cell-size.

Definition at line 589 of file BioGen.cpp.

◆ FreezeWaterBiomes()

void cBioGenMultiStepMap::FreezeWaterBiomes ( cChunkDef::BiomeMap a_BiomeMap,
const IntMap a_TemperatureMap 
)
protected

Flips biOcean and biRiver into biFrozenOcean and biFrozenRiver if the temperature is too low.

Definition at line 688 of file BioGen.cpp.

◆ GenBiomes()

void cBioGenMultiStepMap::GenBiomes ( cChunkCoords  a_ChunkCoords,
cChunkDef::BiomeMap a_BiomeMap 
)
overrideprotectedvirtual

Generates biomes for the given chunk.

Implements cBiomeGen.

Definition at line 430 of file BioGen.cpp.

◆ InitializeBiomeGen()

void cBioGenMultiStepMap::InitializeBiomeGen ( cIniFile a_IniFile)
overrideprotectedvirtual

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

Reimplemented from cBiomeGen.

Definition at line 417 of file BioGen.cpp.

Member Data Documentation

◆ m_LandBiomesSize

float cBioGenMultiStepMap::m_LandBiomesSize
protected

Definition at line 247 of file BioGen.h.

◆ m_MushroomIslandSize

int cBioGenMultiStepMap::m_MushroomIslandSize
protected

Definition at line 244 of file BioGen.h.

◆ m_Noise1

cNoise cBioGenMultiStepMap::m_Noise1
protected

Definition at line 235 of file BioGen.h.

◆ m_Noise2

cNoise cBioGenMultiStepMap::m_Noise2
protected

Definition at line 236 of file BioGen.h.

◆ m_Noise3

cNoise cBioGenMultiStepMap::m_Noise3
protected

Definition at line 237 of file BioGen.h.

◆ m_Noise4

cNoise cBioGenMultiStepMap::m_Noise4
protected

Definition at line 238 of file BioGen.h.

◆ m_Noise5

cNoise cBioGenMultiStepMap::m_Noise5
protected

Definition at line 239 of file BioGen.h.

◆ m_Noise6

cNoise cBioGenMultiStepMap::m_Noise6
protected

Definition at line 240 of file BioGen.h.

◆ m_OceanCellSize

int cBioGenMultiStepMap::m_OceanCellSize
protected

Definition at line 243 of file BioGen.h.

◆ m_RiverCellSize

int cBioGenMultiStepMap::m_RiverCellSize
protected

Definition at line 245 of file BioGen.h.

◆ m_RiverWidthThreshold

double cBioGenMultiStepMap::m_RiverWidthThreshold
protected

Definition at line 246 of file BioGen.h.

◆ m_Seed

int cBioGenMultiStepMap::m_Seed
protected

Definition at line 242 of file BioGen.h.


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