diff options
author | Tyler Murphy <tylermurphy534@gmail.com> | 2022-09-26 11:03:27 -0400 |
---|---|---|
committer | Tyler Murphy <tylermurphy534@gmail.com> | 2022-09-26 11:03:27 -0400 |
commit | b579882324b6f20e04220f6cea735481abf18d47 (patch) | |
tree | af2670c05b49d9ba95cbc8769e781c091bba94db /src/first_app.cpp | |
parent | MSAA (diff) | |
download | minecraftvulkan-b579882324b6f20e04220f6cea735481abf18d47.tar.gz minecraftvulkan-b579882324b6f20e04220f6cea735481abf18d47.tar.bz2 minecraftvulkan-b579882324b6f20e04220f6cea735481abf18d47.zip |
multichunk meshing
Diffstat (limited to 'src/first_app.cpp')
-rwxr-xr-x | src/first_app.cpp | 22 |
1 files changed, 16 insertions, 6 deletions
diff --git a/src/first_app.cpp b/src/first_app.cpp index 80ee78c..a16ecde 100755 --- a/src/first_app.cpp +++ b/src/first_app.cpp @@ -46,13 +46,23 @@ void FirstApp::run() { void FirstApp::loadGameObjects() { - Chunk* chunk = Chunk::newChunk(0, 0, 123); - chunk->createMesh(); + for(int x = 0; x < 10; x++) { + for(int z = 0; z < 10; z++) { + Chunk* chunk = Chunk::newChunk(x, z, 53463); + } + } - auto chunkObject = xe::GameObject::createGameObject(); - chunkObject.model = chunk->getMesh(); - chunkObject.transform.translation = {0.f, 0.f, 0.f}; - gameObjects.push_back(std::move(chunkObject)); + for(int x = 0; x < 10; x++) { + for(int z = 0; z < 10; z++) { + Chunk* chunk = Chunk::getChunk(x,z); + chunk->createMesh(); + + auto chunkObject = xe::GameObject::createGameObject(); + chunkObject.model = chunk->getMesh(); + chunkObject.transform.translation = {16.f*x, 0.f, 16.f*z}; + gameObjects.push_back(std::move(chunkObject)); + } + } } |