]> git.localhorst.tv Git - blank.git/blobdiff - src/world.hpp
use indices for model rendering
[blank.git] / src / world.hpp
index 8ef2b21b2b05ee7d7106a8af536e0a2bf36e85b4..461da5623f5874c7fae25e9923359eaa29e4ead5 100644 (file)
@@ -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,13 @@ public:
 
        Entity &Player() { return player; }
 
-       Chunk &Next(const Chunk &, const glm::vec3 &dir);
+       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);
+       void CheckChunkGeneration();
 
        void Render(DirectionalLighting &);
 
@@ -53,9 +57,11 @@ private:
        SimplexNoise colorNoise;
 
        Entity player;
+       Chunk::Pos player_chunk;
 
        std::list<Chunk> loaded;
        std::list<Chunk> to_generate;
+       std::list<Chunk> to_free;
 
 };