X-Git-Url: http://git.localhorst.tv/?a=blobdiff_plain;f=src%2Fworld.hpp;h=461da5623f5874c7fae25e9923359eaa29e4ead5;hb=eca1fdcc8e34a4918418b2de122c6200aeb7ceaf;hp=60ec6f4dbeca36c1b7364f4834ad3cec54a3e3b7;hpb=804bde3fc09e4317eef629861638a68bfad3e343;p=blank.git diff --git a/src/world.hpp b/src/world.hpp index 60ec6f4..461da56 100644 --- a/src/world.hpp +++ b/src/world.hpp @@ -3,7 +3,7 @@ #include "block.hpp" #include "chunk.hpp" -#include "controller.hpp" +#include "entity.hpp" #include "noise.hpp" #include "shader.hpp" #include "shape.hpp" @@ -19,7 +19,7 @@ class World { public: World(); - void Generate(const glm::tvec3 &from, const glm::tvec3 &to); + void Generate(const Chunk::Pos &from, const Chunk::Pos &to); bool Intersection( const Ray &, @@ -32,11 +32,15 @@ public: BlockTypeRegistry &BlockTypes() { return blockType; } std::list &LoadedChunks() { return loaded; } - FPSController &Controller() { return player; } + 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 &dir); void Update(int dt); + void CheckChunkGeneration(); void Render(DirectionalLighting &); @@ -52,10 +56,12 @@ private: SimplexNoise blockNoise; SimplexNoise colorNoise; - FPSController player; + Entity player; + Chunk::Pos player_chunk; std::list loaded; std::list to_generate; + std::list to_free; };