summaryrefslogtreecommitdiff
path: root/src/first_app.cpp
diff options
context:
space:
mode:
authorTyler Murphy <tylermurphy534@gmail.com>2022-09-26 11:03:27 -0400
committerTyler Murphy <tylermurphy534@gmail.com>2022-09-26 11:03:27 -0400
commitb579882324b6f20e04220f6cea735481abf18d47 (patch)
treeaf2670c05b49d9ba95cbc8769e781c091bba94db /src/first_app.cpp
parentMSAA (diff)
downloadminecraftvulkan-b579882324b6f20e04220f6cea735481abf18d47.tar.gz
minecraftvulkan-b579882324b6f20e04220f6cea735481abf18d47.tar.bz2
minecraftvulkan-b579882324b6f20e04220f6cea735481abf18d47.zip
multichunk meshing
Diffstat (limited to 'src/first_app.cpp')
-rwxr-xr-xsrc/first_app.cpp22
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));
+ }
+ }
}