Cuberite
A lightweight, fast and extensible game server for Minecraft
|
The interface that a terrain shape generator must implement A terrain shape generator takes chunk coords on input and outputs a 3D array of "shape" for that chunk. More...
#include <ComposableGenerator.h>
Public Member Functions | |
virtual void | GenShape (cChunkCoords a_ChunkCoords, cChunkDesc::Shape &a_Shape)=0 |
Generates the shape for the given chunk. More... | |
virtual void | InitializeShapeGen (cIniFile &a_IniFile) |
Reads parameters from the ini file, prepares generator for use. More... | |
virtual | ~cTerrainShapeGen () |
Static Public Member Functions | |
static std::unique_ptr< cTerrainShapeGen > | CreateShapeGen (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... | |
The interface that a terrain shape generator must implement A terrain shape generator takes chunk coords on input and outputs a 3D array of "shape" for that chunk.
The shape here represents the distinction between air and solid; there's no representation of Water since that is added by the composition geenrator. The output array is indexed [y + 256 * z + 16 * 256 * x], so that it's fast to later compose a single column of the terrain, which is the dominant operation following the shape generation. The generator may request biome information from the underlying BiomeGen, it may even request information for other chunks than the one it's currently generating (neighbors - for averaging)
Definition at line 78 of file ComposableGenerator.h.
|
inlinevirtual |
Definition at line 81 of file ComposableGenerator.h.
|
static |
Creates the correct TerrainShapeGen descendant based on the ini file settings and the seed provided.
a_BiomeGen is the underlying biome generator, some shape generators may depend on it providing additional biomes data around the chunk a_CacheOffByDefault gets set to whether the cache should be disabled by default Implemented in ShapeGen.cpp!
Definition at line 78 of file ShapeGen.cpp.
|
pure virtual |
Generates the shape for the given chunk.
Implemented in cTwoHeights, cTerrainHeightToShapeGen, cBiomalNoise3DComposable, cNoise3DComposable, cEndGen, and cDistortedHeightmap.
|
inlinevirtual |
Reads parameters from the ini file, prepares generator for use.
Reimplemented in cTwoHeights, cTerrainHeightToShapeGen, cBiomalNoise3DComposable, cNoise3DComposable, cEndGen, and cDistortedHeightmap.
Definition at line 87 of file ComposableGenerator.h.