diff options
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)); + } + } } |