1 #ifndef BLANK_WORLD_HPP_
2 #define BLANK_WORLD_HPP_
7 #include "generator.hpp"
12 #include <glm/glm.hpp>
21 // initial player position
22 glm::vec3 spawn = { 4.0f, 4.0f, 4.0f };
23 // direction facing towards(!) the light
24 glm::vec3 light_direction = { -1.0f, -3.0f, -2.0f };
25 // fade out reaches 1/e (0.3679) at 1/fog_density,
26 // gets less than 0.01 at e/(2 * fog_density)
27 // I chose 0.011 because it yields 91 and 124 for those, so
28 // slightly less than 6 and 8 chunks
29 float fog_density = 0.011f;
31 Generator::Config gen = Generator::Config();
32 ChunkLoader::Config load = ChunkLoader::Config();
35 explicit World(const Config &);
40 Chunk **chunk = nullptr,
42 float *dist = nullptr,
43 glm::vec3 *normal = nullptr);
45 BlockTypeRegistry &BlockTypes() { return blockType; }
47 Entity &Player() { return *player; }
48 Entity &AddEntity() { entities.emplace_back(); return entities.back(); }
51 Chunk &Next(const Chunk &to, const glm::tvec3<int> &dir);
55 void Render(DirectionalLighting &);
58 BlockTypeRegistry blockType;
59 CuboidShape blockShape;
60 StairShape stairShape;
61 CuboidShape slabShape;
67 std::list<Entity> entities;
69 glm::vec3 light_direction;