Skip to content

Commit

Permalink
Imports Refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
Berags committed May 4, 2022
1 parent 3d8c257 commit 5ea6d30
Show file tree
Hide file tree
Showing 18 changed files with 123 additions and 109 deletions.
9 changes: 1 addition & 8 deletions first_app.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,6 @@ FirstApp::FirstApp() {
FirstApp::~FirstApp() = default;

void FirstApp::run() {
Engine::ECS::Entity entity = Engine::ECS::Entity::create();
Engine::ECS::TestComponent *testComponent{new Engine::ECS::TestComponent()};
entity.addComponent(testComponent);
entity.update(.0f);

Engine::ImGuiManager imGui{window, device, renderer.getSwapChainRenderPass(), renderer.getImageCount()};

std::vector<std::unique_ptr<Engine::Buffer>> uboBuffers(Engine::SwapChain::MAX_FRAMES_IN_FLIGHT);
Expand Down Expand Up @@ -80,7 +75,7 @@ void FirstApp::run() {
camera.setViewYXZ(viewerObject.transform.translation, viewerObject.transform.rotation);

float aspectRatio = renderer.getAspectRatio();
camera.setProspectiveProjection(glm::radians(50.f), aspectRatio, .1f, 100.f);
camera.setProspectiveProjection(glm::radians(80.f), aspectRatio, .1f, 25.f);

if (auto commandBuffer = renderer.beginFrame()) {
imGui.newFrame();
Expand Down Expand Up @@ -108,8 +103,6 @@ void FirstApp::run() {
renderSystem.renderGameObjects(frameInfo);
pointLightSystem.render(frameInfo);

entity.update(frameTime);

// ImGui rendering
imGui.run(frameInfo);
imGui.render(commandBuffer);
Expand Down
1 change: 1 addition & 0 deletions include/engine/Core.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
#include "ecs/IComponent.h"
#include "ecs/TestComponent.h"
#include "ecs/Entity.h"
#include "ecs/EntityManager.h"

#include "systems/RenderSystem.h"
#include "systems/PointLightSystem.h"
Expand Down
2 changes: 1 addition & 1 deletion include/engine/KeyboardMovementController.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ namespace Engine {
private:
KeyMappings keys{};
const float moveSpeed{3.f};
const float lookSpeed{2.f};
const float lookSpeed{3.f};
};
}

Expand Down
142 changes: 71 additions & 71 deletions json/game_state.json
Original file line number Diff line number Diff line change
@@ -1,87 +1,86 @@
[
{
"model": {
"file_name": "../models/quad.obj"
"file_name": "../models/smooth_vase.obj"
},
"name": "Grounda",
"name": "Vase",
"transform": {
"color": {
"x": 0.44999998807907104,
"y": 0.550000011920929,
"z": 0.6000000238418579
"x": 0.0,
"y": 0.0,
"z": 0.0
},
"rotation": {
"x": 0.0,
"y": 0.0,
"z": 0.0
"z": 0.7900000214576721
},
"scale": {
"x": 54.310001373291016,
"y": 54.310001373291016,
"z": 54.310001373291016
"x": 1.0,
"y": 1.0,
"z": 1.0
},
"translation": {
"x": 6.0,
"y": 0.5,
"z": 0.0
"x": -1.4600000381469727,
"y": -0.9399999976158142,
"z": 1.0
}
}
},
{
"intensity": 1.0,
"intensity": 10.0,
"model": {
"file_name": null
},
"name": "Point Lights",
"name": "Sun",
"transform": {
"color": {
"x": 0.02380955219268799,
"y": 1.0,
"z": 0.0
"x": 0.9945054650306702,
"y": 0.9945001006126404,
"z": 0.9944955110549927
},
"rotation": {
"x": 0.0,
"y": 0.0,
"z": 0.0
},
"scale": {
"x": 0.10000000149011612,
"y": 0.10000000149011612,
"z": 0.10000000149011612
"x": 0.0,
"y": 0.0,
"z": 0.0
},
"translation": {
"x": -0.9700000286102295,
"y": 0.3199999928474426,
"z": 1.2699999809265137
"x": 0.0,
"y": -6.260000228881836,
"z": 0.0
}
}
},
{
"intensity": 1.0,
"model": {
"file_name": null
"file_name": "../models/cube.obj"
},
"name": "Point Light",
"name": "Cube",
"transform": {
"color": {
"x": 0.8791208863258362,
"y": 0.10626735538244247,
"z": 0.10626735538244247
},
"rotation": {
"x": 0.0,
"y": 0.0,
"z": 0.0
},
"rotation": {
"x": -0.4000000059604645,
"y": -1.1399999856948853,
"z": 0.0
},
"scale": {
"x": 0.03999999910593033,
"y": 0.03999999910593033,
"z": 0.03999999910593033
"x": 0.05000000074505806,
"y": 0.05000000074505806,
"z": 0.05000000074505806
},
"translation": {
"x": 0.0,
"y": 0.0,
"z": 0.0
"y": 0.4000000059604645,
"z": 0.4000000059604645
}
}
},
Expand Down Expand Up @@ -114,87 +113,88 @@
}
},
{
"intensity": 1.0,
"model": {
"file_name": "../models/cube.obj"
"file_name": null
},
"name": "Cube",
"name": "Point Light",
"transform": {
"color": {
"x": 0.0,
"y": 0.0,
"z": 0.0
"x": 0.8791208863258362,
"y": 0.10626735538244247,
"z": 0.10626735538244247
},
"rotation": {
"x": -0.4000000059604645,
"y": -1.1399999856948853,
"x": 0.0,
"y": 0.0,
"z": 0.0
},
"scale": {
"x": 0.05000000074505806,
"y": 0.05000000074505806,
"z": 0.05000000074505806
"x": 0.03999999910593033,
"y": 0.03999999910593033,
"z": 0.03999999910593033
},
"translation": {
"x": 0.0,
"y": 0.4000000059604645,
"z": 0.4000000059604645
"y": 0.0,
"z": 0.0
}
}
},
{
"intensity": 10.0,
"intensity": 1.0,
"model": {
"file_name": null
},
"name": "Sun",
"name": "Point Lights",
"transform": {
"color": {
"x": 0.9945054650306702,
"y": 0.9945001006126404,
"z": 0.9944955110549927
"x": 0.02380955219268799,
"y": 1.0,
"z": 0.0
},
"rotation": {
"x": 0.0,
"y": 0.0,
"z": 0.0
},
"scale": {
"x": 0.0,
"y": 0.0,
"z": 0.0
"x": 0.10000000149011612,
"y": 0.10000000149011612,
"z": 0.10000000149011612
},
"translation": {
"x": 0.0,
"y": -6.260000228881836,
"z": 0.0
"x": -0.9700000286102295,
"y": 0.3199999928474426,
"z": 1.2699999809265137
}
}
},
{
"model": {
"file_name": "../models/smooth_vase.obj"
"file_name": "../models/quad.obj"
},
"name": "smooth_vase.obj",
"name": "Grounda",
"transform": {
"color": {
"x": 0.0,
"y": 0.0,
"z": 0.0
"x": 0.44999998807907104,
"y": 0.550000011920929,
"z": 0.6000000238418579
},
"rotation": {
"x": 0.0,
"y": 0.0,
"z": 0.7900000214576721
"z": 0.0
},
"scale": {
"x": 1.0,
"y": 1.0,
"z": 1.0
"x": 54.310001373291016,
"y": 54.310001373291016,
"z": 54.310001373291016
},
"translation": {
"x": -1.4600000381469727,
"y": -0.9399999976158142,
"z": 1.0
"x": 6.0,
"y": 0.5,
"z": 0.0
}
}
}
Expand Down
7 changes: 4 additions & 3 deletions src/engine/Buffer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,13 @@
// Created by Jacopo Beragnoli on 16/04/22.
//

#include "../../include/engine/Buffer.h"

// std
// libs
#include <cassert>
#include <cstring>

// includes
#include "../../include/engine/Buffer.h"

namespace Engine {

/**
Expand Down
5 changes: 4 additions & 1 deletion src/engine/Camera.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,13 @@
// Created by Jacopo Beragnoli on 15/04/22.
//

#include "../../include/engine/Camera.h"
// libs
#include <cassert>
#include <limits>

// includes
#include "../../include/engine/Camera.h"

namespace Engine {

void Camera::setOrthographicProjection(float left, float right, float top, float bottom, float near, float far) {
Expand Down
5 changes: 4 additions & 1 deletion src/engine/Descriptors.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,13 @@
// Created by Jacopo Beragnoli on 26/04/22.
//

#include "../../include/engine/Descriptors.h"
// libs
#include <cassert>
#include <stdexcept>

// includes
#include "../../include/engine/Descriptors.h"

namespace Engine {
// *************** Descriptor Set Layout Builder *********************

Expand Down
3 changes: 3 additions & 0 deletions src/engine/Device.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,12 @@
// Created by Jacopo Beragnoli on 06/04/22.
//

// libs
#include <iostream>
#include <set>
#include <unordered_set>

// includes
#include "../../include/engine/Device.h"
#include "../../include/engine/exceptions/vulkan/FailedToFindVulkanSupportedGPUException.h"

Expand Down
1 change: 1 addition & 0 deletions src/engine/GameObject.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// Created by Jacopo Beragnoli on 13/04/22.
//

// includes
#include "../../include/engine/GameObject.h"

namespace Engine {
Expand Down
5 changes: 4 additions & 1 deletion src/engine/ImGuiManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,13 @@
// Created by Jacopo Beragnoli on 26/04/22.
//

#include "../../include/engine/ImGuiManager.h"
// libs
#include <vulkan/vulkan_core.h>
#include <stdexcept>

// includes
#include "../../include/engine/ImGuiManager.h"

namespace Engine {
ImGuiManager::ImGuiManager(
Engine::Window &window, Engine::Device &device, VkRenderPass renderPass, uint32_t imageCount)
Expand Down
Loading

0 comments on commit 5ea6d30

Please sign in to comment.