X-Git-Url: http://git.localhorst.tv/?a=blobdiff_plain;f=src%2Fworld.hpp;h=1d43fbe7ffce45e2929ea659ea48293be33daa33;hb=83ed3de28841d1eecfca39ff540e804cf6809b32;hp=bca1e0c082e190aadfe147abd2efcd7b852b69d5;hpb=bd6bd2c875f4b6baef913e5315aa9f7e7cd7da7a;p=blank.git diff --git a/src/world.hpp b/src/world.hpp index bca1e0c..1d43fbe 100644 --- a/src/world.hpp +++ b/src/world.hpp @@ -17,7 +17,22 @@ namespace blank { class World { public: - explicit World(unsigned int seed); + 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 &, @@ -37,7 +52,7 @@ public: void Update(int dt); - void Render(DirectionalLighting &); + void Render(BlockLighting &, DirectionalLighting &); private: BlockTypeRegistry blockType; @@ -51,6 +66,9 @@ private: Entity *player; std::list entities; + glm::vec3 light_direction; + float fog_density; + }; }