X-Git-Url: http://git.localhorst.tv/?a=blobdiff_plain;f=src%2Fworld.hpp;h=3dd04fb31add2b0a8738328c824f54884875b21a;hb=d2d3cb877984b97fafb97254f5005cbf4bcf47a6;hp=87835408e41fed324922efb7f35ca0a6e1bc7178;hpb=9eb7fb38870c6324580683752d49d62b7a431bce;p=blank.git diff --git a/src/world.hpp b/src/world.hpp index 8783540..3dd04fb 100644 --- a/src/world.hpp +++ b/src/world.hpp @@ -17,7 +17,22 @@ namespace blank { class World { public: - World(); + struct Config { + // initial player position + glm::vec3 spawn = { 4.0f, 4.0f, 4.0f }; + // direction facing towards(!) the light + glm::vec3 light_direction = { -1.0f, -3.0f, -2.0f }; + // fade out reaches 1/e (0.3679) at 1/fog_density, + // gets less than 0.01 at e/(2 * fog_density) + // I chose 0.011 because it yields 91 and 124 for those, so + // slightly less than 6 and 8 chunks + float fog_density = 0.011f; + + Generator::Config gen = Generator::Config(); + ChunkLoader::Config load = ChunkLoader::Config(); + }; + + explicit World(const Config &); bool Intersection( const Ray &, @@ -32,6 +47,7 @@ public: Entity &Player() { return *player; } Entity &AddEntity() { entities.emplace_back(); return entities.back(); } + Chunk &PlayerChunk(); Chunk &Next(const Chunk &to, const glm::tvec3 &dir); void Update(int dt); @@ -50,6 +66,9 @@ private: Entity *player; std::list entities; + glm::vec3 light_direction; + float fog_density; + }; }