diff options
author | tylermurphy534 <tylermurphy534@gmail.com> | 2022-10-01 16:28:38 -0400 |
---|---|---|
committer | tylermurphy534 <tylermurphy534@gmail.com> | 2022-10-01 16:28:38 -0400 |
commit | 4f83af18578f2ff7036f7f7729619fea8acb8edc (patch) | |
tree | 48625d9e42b3688df76fc947b4dfa557546d811b /src/world.hpp | |
parent | rename src files, move .o to /bin (diff) | |
download | minecraftvulkan-4f83af18578f2ff7036f7f7729619fea8acb8edc.tar.gz minecraftvulkan-4f83af18578f2ff7036f7f7729619fea8acb8edc.tar.bz2 minecraftvulkan-4f83af18578f2ff7036f7f7729619fea8acb8edc.zip |
move chunk loading into world class
Diffstat (limited to 'src/world.hpp')
-rw-r--r-- | src/world.hpp | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/src/world.hpp b/src/world.hpp new file mode 100644 index 0000000..12e0285 --- /dev/null +++ b/src/world.hpp @@ -0,0 +1,43 @@ +#pragma once + +#include "xe_game_object.hpp" +#include "chunk_renderer.hpp" +#include "chunk.hpp" + +#include <vector> + +namespace app { + +class World { + + public: + + World(xe::GameObject& viewer, int renderDistance, int worldSeed); + ~World(); + + void reloadChunks(); + void reloadChunks(int newRenderDistance); + + void render(xe::Camera& camera); + + private: + + void resetChunks(); + + void unloadOldChunks(); + void loadNewChunks(); + void updateChunkMeshs(); + + int viewX, viewZ; + + int worldSeed; + int renderDistance; + + const xe::GameObject& viewer; + std::vector<xe::GameObject> loadedChunks; + + ChunkRenderer chunkRenderer; + +}; + +}
\ No newline at end of file |