X-Git-Url: http://git.localhorst.tv/?a=blobdiff_plain;f=src%2Fgenerator.hpp;h=70c38f59941e517e62de8a9a6920db9610c235f4;hb=4485397da18a25dfd1a51e864814887b66ba0f2e;hp=9dc39cb54a30bbdd19d59ab79506898472c6c523;hpb=2d5671c2ef977defae9ce0ce7248582ab3e8f011;p=blank.git diff --git a/src/generator.hpp b/src/generator.hpp index 9dc39cb..70c38f5 100644 --- a/src/generator.hpp +++ b/src/generator.hpp @@ -13,21 +13,30 @@ namespace blank { class Generator { public: - explicit Generator(unsigned int seed); + struct Config { + unsigned int solid_seed = 0; + unsigned int type_seed = 0; + float stretch = 64.0f; + float solid_threshold = 0.5f; + }; + + explicit Generator(const Config &); void operator ()(Chunk &) const; void Space(Block::Type t) { space = t; } + void Light(Block::Type t) { light = t; } void Solids(const std::vector &s) { solids = s; } private: SimplexNoise solidNoise; - SimplexNoise typeNoise; + WorleyNoise typeNoise; float stretch; float solid_threshold; Block::Type space; + Block::Type light; std::vector solids; };