X-Git-Url: http://git.localhorst.tv/?a=blobdiff_plain;f=src%2Fgenerator.hpp;h=3d7ceaff801d82bc2d16e011b4e4d844d4a4a801;hb=e74f1ad236429f05db90c0ace825277e2a3fbc05;hp=a40184bf719794e2cde735da82c865e452d3aca8;hpb=8acc3f990f1a5ee00471f72c150b407164149f2d;p=blank.git diff --git a/src/generator.hpp b/src/generator.hpp index a40184b..3d7ceaf 100644 --- a/src/generator.hpp +++ b/src/generator.hpp @@ -13,19 +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; };