X-Git-Url: http://git.localhorst.tv/?a=blobdiff_plain;f=src%2Fworld.hpp;h=ccd743dd4f1321955410ef1e055f5354140bdb16;hb=30d36f3d545617faef76f90c4121d6ed118ba272;hp=8ef2b21b2b05ee7d7106a8af536e0a2bf36e85b4;hpb=cb959294a8271969ddfe411471d7f04e82c4788a;p=blank.git diff --git a/src/world.hpp b/src/world.hpp index 8ef2b21..ccd743d 100644 --- a/src/world.hpp +++ b/src/world.hpp @@ -4,11 +4,10 @@ #include "block.hpp" #include "chunk.hpp" #include "entity.hpp" -#include "noise.hpp" +#include "generator.hpp" #include "shader.hpp" #include "shape.hpp" -#include #include @@ -19,8 +18,6 @@ class World { public: World(); - void Generate(const glm::tvec3 &from, const glm::tvec3 &to); - bool Intersection( const Ray &, const glm::mat4 &M, @@ -30,33 +27,26 @@ public: glm::vec3 *normal = nullptr); BlockTypeRegistry &BlockTypes() { return blockType; } - std::list &LoadedChunks() { return loaded; } Entity &Player() { return player; } - Chunk &Next(const Chunk &, const glm::vec3 &dir); + Chunk &Next(const Chunk &to, const glm::tvec3 &dir); void Update(int dt); void Render(DirectionalLighting &); -private: - void Generate(Chunk &); - private: BlockTypeRegistry blockType; CuboidShape blockShape; StairShape stairShape; CuboidShape slabShape; - SimplexNoise blockNoise; - SimplexNoise colorNoise; + Generator generate; + ChunkLoader chunks; Entity player; - std::list loaded; - std::list to_generate; - }; }