Changeset cd1cb0f in opengl-game for vulkan-game.cpp
- Timestamp:
- Dec 24, 2019, 12:48:49 AM (5 years ago)
- Branches:
- feature/imgui-sdl, master, points-test
- Children:
- 0fe8433
- Parents:
- a79be34
- git-author:
- Dmitry Portnoy <dmitry.portnoy@…> (12/22/19 03:45:12)
- git-committer:
- Dmitry Portnoy <dmitry.portnoy@…> (12/24/19 00:48:49)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
vulkan-game.cpp
ra79be34 rcd1cb0f 508 508 509 509 createSyncObjects(); 510 511 shipPipeline.getObjects()[0].model_base = 512 translate(mat4(1.0f), vec3(0.0f, -1.2f, 1.65f)) * 513 scale(mat4(1.0f), vec3(0.1f, 0.1f, 0.1f)); 510 514 } 511 515 … … 608 612 } 609 613 614 // Check which keys are held down 615 616 if (gui->keyPressed(SDL_SCANCODE_LEFT)) { 617 transformObject(shipPipeline.getObjects()[0], translate(mat4(1.0f), vec3(-0.01f, 0.0f, 0.0f))); 618 } else if (gui->keyPressed(SDL_SCANCODE_RIGHT)) { 619 transformObject(shipPipeline.getObjects()[0], translate(mat4(1.0f), vec3(0.01f, 0.0f, 0.0f))); 620 } 621 610 622 renderUI(); 611 623 renderScene(); … … 623 635 float time = chrono::duration<float, chrono::seconds::period>(currentTime - startTime).count(); 624 636 637 // TODO: Will need to change this to go through all objects of all pipelines and update their model mats 638 625 639 so_Object.model = 626 640 translate(mat4(1.0f), vec3(0.0f, -2.0f, -0.0f)) * 627 641 rotate(mat4(1.0f), time * radians(90.0f), vec3(0.0f, 0.0f, 1.0f)); 628 642 629 so_Ship.model = 630 translate(mat4(1.0f), vec3(0.0f, -1.2f, 1.65f)) * 631 scale(mat4(1.0f), vec3(0.1f, 0.1f, 0.1f)); 643 so_Ship.model = shipPipeline.getObjects()[0].model_transform * shipPipeline.getObjects()[0].model_base; 632 644 633 645 VulkanUtils::copyDataToMemory(device, uniformBuffersMemory_scenePipeline[currentImage], object_VP_mats);
Note:
See TracChangeset
for help on using the changeset viewer.