X-Git-Url: http://git.localhorst.tv/?a=blobdiff_plain;f=src%2Fgenerator.hpp;h=3d7ceaff801d82bc2d16e011b4e4d844d4a4a801;hb=e74f1ad236429f05db90c0ace825277e2a3fbc05;hp=9dc39cb54a30bbdd19d59ab79506898472c6c523;hpb=2d5671c2ef977defae9ce0ce7248582ab3e8f011;p=blank.git diff --git a/src/generator.hpp b/src/generator.hpp index 9dc39cb..3d7ceaf 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.8f; + }; + + 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; };