]> git.localhorst.tv Git - blank.git/blobdiff - src/world.hpp
add building notes
[blank.git] / src / world.hpp
index 4c7a59f4f607fae03c9ef297f5a4657466199d55..4823c47b0c8c0ec804f62f10c5d83f4e5c2dbd04 100644 (file)
@@ -4,7 +4,7 @@
 #include "block.hpp"
 #include "chunk.hpp"
 #include "entity.hpp"
-#include "noise.hpp"
+#include "generator.hpp"
 #include "shader.hpp"
 #include "shape.hpp"
 
@@ -19,7 +19,7 @@ class World {
 public:
        World();
 
-       void Generate(const glm::tvec3<int> &from, const glm::tvec3<int> &to);
+       void Generate(const Chunk::Pos &from, const Chunk::Pos &to);
 
        bool Intersection(
                const Ray &,
@@ -34,9 +34,9 @@ public:
 
        Entity &Player() { return player; }
 
-       Chunk *ChunkLoaded(const glm::tvec3<int> &);
-       Chunk *ChunkQueued(const glm::tvec3<int> &);
-       Chunk *ChunkAvailable(const glm::tvec3<int> &);
+       Chunk *ChunkLoaded(const Chunk::Pos &);
+       Chunk *ChunkQueued(const Chunk::Pos &);
+       Chunk *ChunkAvailable(const Chunk::Pos &);
        Chunk &Next(const Chunk &, const glm::tvec3<int> &dir);
 
        void Update(int dt);
@@ -44,20 +44,16 @@ public:
 
        void Render(DirectionalLighting &);
 
-private:
-       void Generate(Chunk &);
-
 private:
        BlockTypeRegistry blockType;
        CuboidShape blockShape;
        StairShape stairShape;
        CuboidShape slabShape;
 
-       SimplexNoise blockNoise;
-       SimplexNoise colorNoise;
+       Generator generate;
 
        Entity player;
-       glm::tvec3<int> player_chunk;
+       Chunk::Pos player_chunk;
 
        std::list<Chunk> loaded;
        std::list<Chunk> to_generate;