diff --git a/CMakeLists.txt b/CMakeLists.txt index 4962928..528d0b4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -29,4 +29,4 @@ set(dev_definitions JPH_OBJECT_STREAM ) -target_compile_definitions(${PROJECT_NAME} PRIVATE ${dev_definitions}) +target_compile_definitions(${PROJECT_NAME} PRIVATE ${dev_definitions}) \ No newline at end of file diff --git a/TestApp/Scenes/Assets/Components/Graphics/Meshes/ChildrenMeshes/CubeMesh.hpp b/TestApp/Scenes/Assets/Components/Graphics/Meshes/ChildrenMeshes/CubeMesh.hpp index a1889c2..ef91d32 100644 --- a/TestApp/Scenes/Assets/Components/Graphics/Meshes/ChildrenMeshes/CubeMesh.hpp +++ b/TestApp/Scenes/Assets/Components/Graphics/Meshes/ChildrenMeshes/CubeMesh.hpp @@ -1,8 +1,8 @@ #pragma once -class CubeMesh +#include +class CubeMesh : public MeshContainer { public: CubeMesh(); - void Draw(); }; \ No newline at end of file diff --git a/TestApp/Scenes/Assets/Components/Graphics/Meshes/ChildrenMeshes/SphereMesh.hpp b/TestApp/Scenes/Assets/Components/Graphics/Meshes/ChildrenMeshes/SphereMesh.hpp index 43aafef..554f674 100644 --- a/TestApp/Scenes/Assets/Components/Graphics/Meshes/ChildrenMeshes/SphereMesh.hpp +++ b/TestApp/Scenes/Assets/Components/Graphics/Meshes/ChildrenMeshes/SphereMesh.hpp @@ -1,14 +1,8 @@ #pragma once -#include "Core/SceneManagment/Components/GameComponent.hpp" -#include "Scenes/Assets/Components/Physics/PhysicsBody3D.hpp" +#include -class SphereMesh : public engine3d::GameComponent +class SphereMesh : public MeshContainer { public: - SphereMesh(int Radius, int SectorCount, int StackCount) - void CreateSphere(); - - private: - engine3d::Transform m_Transform; - glm::vec3* m_TransformPosition; + SphereMesh(int Radius, int SectorCount, int StackCount); }; \ No newline at end of file diff --git a/TestApp/Scenes/Assets/Components/Graphics/Meshes/MeshContainer.hpp b/TestApp/Scenes/Assets/Components/Graphics/Meshes/MeshContainer.hpp index 7f7fd58..8491f0c 100644 --- a/TestApp/Scenes/Assets/Components/Graphics/Meshes/MeshContainer.hpp +++ b/TestApp/Scenes/Assets/Components/Graphics/Meshes/MeshContainer.hpp @@ -1,17 +1,18 @@ -#include -#include -#include - +#pragma once +#include +#include +#include //! @brief Factory class MeshContainer { public: - MeshContainer(); - - - private: + MeshContainer() = default; + std::vector* GetVertices(){return vertices;} + std::vector GetNormals(){return normals;} + std::vector GettexCoords(){return texCoords;} - std::vector vertices; + protected: + std::vector* vertices; std::vector normals; std::vector texCoords; }; \ No newline at end of file diff --git a/TestApp/Scenes/Assets/Components/Graphics/SpriteRender3D.hpp b/TestApp/Scenes/Assets/Components/Graphics/SpriteRender3D.hpp index 861ad20..d04dc5f 100644 --- a/TestApp/Scenes/Assets/Components/Graphics/SpriteRender3D.hpp +++ b/TestApp/Scenes/Assets/Components/Graphics/SpriteRender3D.hpp @@ -1,5 +1,5 @@ -#include +#include #include #include @@ -16,7 +16,7 @@ class SpriteRender3D : public engine3d::GameComponent std::vector texCoords; private: - MeshContainer m_MeshContainer; + MeshContainer* m_MeshContainer; engine3d::Transform m_Transform; glm::vec3* m_TransformPosition; }; \ No newline at end of file diff --git a/TestApp/src/Scenes/Assets/Components/Graphics/Meshes/ChildrenMeshes/CubeMesh.cpp b/TestApp/src/Scenes/Assets/Components/Graphics/Meshes/ChildrenMeshes/CubeMesh.cpp index b5c1dec..a3cedb6 100644 --- a/TestApp/src/Scenes/Assets/Components/Graphics/Meshes/ChildrenMeshes/CubeMesh.cpp +++ b/TestApp/src/Scenes/Assets/Components/Graphics/Meshes/ChildrenMeshes/CubeMesh.cpp @@ -1,63 +1,80 @@ + +#include "Core/internal/Vulkan2Showcase/VulkanModel.hpp" #include -#include -#include +#include +#include -void CubeMesh::Draw() +CubeMesh::CubeMesh() { - Ref CreateCubeMesh(glm::vec3 offset){ - std::vector vertices{ - // left face (white) - {{-.5f, -.5f, -.5f}, {.9f, .9f, .9f}}, - {{-.5f, .5f, .5f}, {.9f, .9f, .9f}}, - {{-.5f, -.5f, .5f}, {.9f, .9f, .9f}}, - {{-.5f, -.5f, -.5f}, {.9f, .9f, .9f}}, - {{-.5f, .5f, -.5f}, {.9f, .9f, .9f}}, - {{-.5f, .5f, .5f}, {.9f, .9f, .9f}}, - - // right face (yellow) - {{.5f, -.5f, -.5f}, {.8f, .8f, .1f}}, - {{.5f, .5f, .5f}, {.8f, .8f, .1f}}, - {{.5f, -.5f, .5f}, {.8f, .8f, .1f}}, - {{.5f, -.5f, -.5f}, {.8f, .8f, .1f}}, - {{.5f, .5f, -.5f}, {.8f, .8f, .1f}}, - {{.5f, .5f, .5f}, {.8f, .8f, .1f}}, - - // top face (orange, remember y axis points down) - {{-.5f, -.5f, -.5f}, {.9f, .6f, .1f}}, - {{.5f, -.5f, .5f}, {.9f, .6f, .1f}}, - {{-.5f, -.5f, .5f}, {.9f, .6f, .1f}}, - {{-.5f, -.5f, -.5f}, {.9f, .6f, .1f}}, - {{.5f, -.5f, -.5f}, {.9f, .6f, .1f}}, - {{.5f, -.5f, .5f}, {.9f, .6f, .1f}}, - - // bottom face (red) - {{-.5f, .5f, -.5f}, {.8f, .1f, .1f}}, - {{.5f, .5f, .5f}, {.8f, .1f, .1f}}, - {{-.5f, .5f, .5f}, {.8f, .1f, .1f}}, - {{-.5f, .5f, -.5f}, {.8f, .1f, .1f}}, - {{.5f, .5f, -.5f}, {.8f, .1f, .1f}}, - {{.5f, .5f, .5f}, {.8f, .1f, .1f}}, - - // nose face (blue) - {{-.5f, -.5f, 0.5f}, {.1f, .1f, .8f}}, - {{.5f, .5f, 0.5f}, {.1f, .1f, .8f}}, - {{-.5f, .5f, 0.5f}, {.1f, .1f, .8f}}, - {{-.5f, -.5f, 0.5f}, {.1f, .1f, .8f}}, - {{.5f, -.5f, 0.5f}, {.1f, .1f, .8f}}, - {{.5f, .5f, 0.5f}, {.1f, .1f, .8f}}, - - // tail face (green) - {{-.5f, -.5f, -0.5f}, {.1f, .8f, .1f}}, - {{.5f, .5f, -0.5f}, {.1f, .8f, .1f}}, - {{-.5f, .5f, -0.5f}, {.1f, .8f, .1f}}, - {{-.5f, -.5f, -0.5f}, {.1f, .8f, .1f}}, - {{.5f, -.5f, -0.5f}, {.1f, .8f, .1f}}, - {{.5f, .5f, -0.5f}, {.1f, .8f, .1f}}, - }; + std::vector verts = + { + {.5f, -.5f, -.5f}, + {.5f, -.5f, .5f}, + {.5f, -.5f, -.5f}, + {.5f, .5f, -.5f}, + {.5f, .5f, .5f}, + {-.5f, -.5f, -.5}, + {.5f, -.5f, .5f}, + {-.5f, -.5f, .5f}, + {-.5f, -.5f, -.5}, + {.5f, -.5f, -.5f}, + {.5f, -.5f, .5f}, + {-.5f, .5f, -.5f}, + {.5f, .5f, .5f}, + {-.5f, .5f, .5f}, + {-.5f, .5f, -.5f}, + {.5f, .5f, -.5f}, + {.5f, .5f, .5f}, + {-.5f, -.5f, 0.5}, + {.5f, .5f, 0.5f}, + {-.5f, .5f, 0.5f}, + {-.5f, -.5f, 0.5}, + {.5f, -.5f, 0.5f}, + {.5f, .5f, 0.5f}, + {-.5f, -.5f, -0.5}, + {.5f, .5f, -0.5f}, + {-.5f, .5f, -0.5}, + {-.5f, -.5f, -0.5}, + {.5f, -.5f, -0.5}, + {.5f, .5f, -0.5f} + + }; + + std::vector colors = + { + {.8f, .8f, .1f}, + {.8f, .8f, .1f}, + {.8f, .8f, .1f}, + {.8f, .8f, .1f}, + {.8f, .8f, .1f}, + {.9f, .6f, .1f}, + {.9f, .6f, .1f}, + {.9f, .6f, .1f}, + {.9f, .6f, .1f}, + {.9f, .6f, .1f}, + {.9f, .6f, .1f}, + {.8f, .1f, .1f}, + {.8f, .1f, .1f}, + {.8f, .1f, .1f}, + {.8f, .1f, .1f}, + {.8f, .1f, .1f}, + {.8f, .1f, .1f}, + + {.1f, .1f, .8f}, + {.1f, .1f, .8f}, + {.1f, .1f, .8f}, + {.1f, .1f, .8f}, + {.1f, .1f, .8f}, + {.1f, .1f, .8f}, + + {.1f, .8f, .1}, + {.1f, .8f, .1f}, + {.1f, .8f, .1f}, + {.1f, .8f, .1}, + {.1f, .8f, .1f}, + {.1f, .8f, .1f} + }; - for (auto& v : vertices) { - v.Position += offset; - } - return CreateRef(vertices, VK_BUFFER_USAGE_VERTEX_BUFFER_BIT, VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT | VK_MEMORY_PROPERTY_HOST_COHERENT_BIT); - } -} \ No newline at end of file + vertices = engine3d::vk::VulkanModel::CreateVertexVector(verts, colors); + +} diff --git a/TestApp/src/Scenes/Assets/Components/Graphics/Meshes/ChildrenMeshes/SphereMesh.cpp b/TestApp/src/Scenes/Assets/Components/Graphics/Meshes/ChildrenMeshes/SphereMesh.cpp index a9776db..58bbc1d 100644 --- a/TestApp/src/Scenes/Assets/Components/Graphics/Meshes/ChildrenMeshes/SphereMesh.cpp +++ b/TestApp/src/Scenes/Assets/Components/Graphics/Meshes/ChildrenMeshes/SphereMesh.cpp @@ -1,10 +1,51 @@ -// #include "Core/EngineLogger.hpp" -// #include -// #include +#include "Core/internal/Vulkan2Showcase/VulkanModel.hpp" #include -using namespace engine3d; +#include +SphereMesh::SphereMesh(int Radius, int SectorCount, int StackCount) +{ -void SphereMesh::CreateSphere(){ - m_Transform = m_GameObjectRef->SceneGetComponent(); - m_TransformPosition = &m_Transform.m_Position; + std::vector verts; + std::vector().swap(normals); + std::vector().swap(verts); + std::vector().swap(texCoords); + float nx, ny, nz, LengthInv = 1.0f / Radius; //vertex normal + float x, y, z, xy; //vertex position + float s, t; //vertex texCoord + float SectorStep = 2 * std::numbers::pi / SectorCount; + float StackStep = std::numbers::pi / StackCount; + float SectorAngle, StackAngle; + for(int i = 0; i <= StackCount; ++i) + { + // starting from pi/2 to -pi/2 + StackAngle = std::numbers::pi / 2 - i * StackStep; + xy = Radius * cosf(StackAngle); // r * cos(u) + z = Radius * sinf(StackAngle); // r * sin(u) + + // add (SectorCount+1) vertices per stack + // first and last vertices have same position + // and normal, but different tex coords + for(int j = 0; j <= SectorCount; ++j) + { + + SectorAngle = j * SectorStep; // starting from 0 to 2pi + + // vertex position (x, y, z) + x = xy * cosf(SectorAngle); // r * cos(u) * cos(v) + y = xy * sinf(SectorAngle); // r * cos(u) * sin(v) + verts.push_back(glm::vec3(x,y,z)); + + // normalized vertex normal (nx, ny, nz) + nx = x * LengthInv; + ny = y * LengthInv; + nz = z * LengthInv; + normals.push_back(glm::vec3(nx,ny,nz)); + + // vertex tex coord (s, t) range between [0, 1] + s = (float)j / SectorCount; + t = (float)i / StackCount; + texCoords.push_back(glm::vec2(s,t)); + } + } + + vertices = engine3d::vk::VulkanModel::CreateVertexVector(verts); } \ No newline at end of file diff --git a/TestApp/src/Scenes/Assets/Components/Graphics/Meshes/MeshContainer.cpp b/TestApp/src/Scenes/Assets/Components/Graphics/Meshes/MeshContainer.cpp index 7bb919b..efab518 100644 --- a/TestApp/src/Scenes/Assets/Components/Graphics/Meshes/MeshContainer.cpp +++ b/TestApp/src/Scenes/Assets/Components/Graphics/Meshes/MeshContainer.cpp @@ -1,53 +1,12 @@ #include #include -void MeshContainer::SphereBlueprint() -{ - std::vector().swap(normals); - std::vector().swap(vertices); - std::vector().swap(texCoords); - float nx, ny, nz, LengthInv = 1.0f / Radius; //vertex normal - float x, y, z, xy; //vertex position - float s, t; //vertex texCoord - float SectorStep = 2 * std::numbers::pi / SectorCount; - float StackStep = std::numbers::pi / StackCount; - float SectorAngle, StackAngle; - for(int i = 0; i <= StackCount; ++i) - { - // starting from pi/2 to -pi/2 - StackAngle = std::numbers::pi / 2 - i * StackStep; - xy = Radius * cosf(StackAngle); // r * cos(u) - z = Radius * sinf(StackAngle); // r * sin(u) - - // add (SectorCount+1) vertices per stack - // first and last vertices have same position - // and normal, but different tex coords - for(int j = 0; j <= SectorCount; ++j) - { - - SectorAngle = j * SectorStep; // starting from 0 to 2pi - - // vertex position (x, y, z) - x = xy * cosf(SectorAngle); // r * cos(u) * cos(v) - y = xy * sinf(SectorAngle); // r * cos(u) * sin(v) - vertices.push_back(glm::vec3(x,y,z)); - - // normalized vertex normal (nx, ny, nz) - nx = x * LengthInv; - ny = y * LengthInv; - nz = z * LengthInv; - normals.push_back(glm::vec3(nx,ny,nz)); - - // vertex tex coord (s, t) range between [0, 1] - s = (float)j / SectorCount; - t = (float)i / StackCount; - texCoords.push_back(glm::vec2(s,t)); - } - } - // For loop is used for printing out the position vectors - for (auto position : vertices) - { - ConsoleLogInfo("vector positions: ({0}, {1}, {2})", position.x, - position.y, position.z); - } -}; +// void MeshContainer::SphereBlueprint() +// { +// // For loop is used for printing out the position vectors +// for (auto position : vertices) +// { +// ConsoleLogInfo("vector positions: ({0}, {1}, {2})", position.x, +// position.y, position.z); +// } +//}; diff --git a/TestApp/src/Scenes/Assets/Components/Graphics/SpriteRender3D.cpp b/TestApp/src/Scenes/Assets/Components/Graphics/SpriteRender3D.cpp index 5204b1f..dea4607 100644 --- a/TestApp/src/Scenes/Assets/Components/Graphics/SpriteRender3D.cpp +++ b/TestApp/src/Scenes/Assets/Components/Graphics/SpriteRender3D.cpp @@ -1,8 +1,4 @@ #include -#include -#include -#include - // #include "Scene" using namespace engine3d; @@ -10,13 +6,7 @@ using namespace engine3d; const int SectorCount = 10; const int StackCount = 10; -SpriteRender3D(MeshContainer* meshBody) : m_MeshContainter(meshBody){} -void SpriteRender3D::CreateMesh() -{ - // TODO: change from hardcoded values later - MeshContainer myMeshContainer(int 1, int 10, int 10); - myMeshContainer.SphereBlueprint(); -}; +SpriteRender3D::SpriteRender3D(MeshContainer* meshBody) : m_MeshContainer(meshBody){} void SpriteRender3D::OnIntegrate() { @@ -33,18 +23,10 @@ void SpriteRender3D::OnIntegrate() m_TransformPosition = &m_Transform.m_Position; }; -void SpriteRender3D::Update() +void SpriteRender3D::Update() { -// std::vector().swap(normals); -// std::vector().swap(vertices); -// std::vector().swap(texCoords); -// float x, y, z, xy; //vertex position -// float nx, ny, nz, LengthInv = 1.0f / Radius; //vertex normal -// float s, t; //vertex texCoord -// float SectorStep = 2 * std::numbers::pi / SectorCount; -// float StackStep = std::numbers::pi / StackCount; -// float SectorAngle, StackAngle; - + //! @note needs to be sent to the vulkanmodal + m_MeshContainer->GetVertices(); }; void SpriteRender3D::LateUpdate() {}; diff --git a/TestApp/src/Scenes/Assets/SceneInstances/ShowCaseSceneInstance.cpp b/TestApp/src/Scenes/Assets/SceneInstances/ShowCaseSceneInstance.cpp index 5ab78fe..2ca01e8 100644 --- a/TestApp/src/Scenes/Assets/SceneInstances/ShowCaseSceneInstance.cpp +++ b/TestApp/src/Scenes/Assets/SceneInstances/ShowCaseSceneInstance.cpp @@ -6,8 +6,8 @@ #include #include #include -#include -#include +#include +#include ShowCaseSceneInstance::ShowCaseSceneInstance() { @@ -24,8 +24,8 @@ void ShowCaseSceneInstance::CreateObjects() BodyContainer * l_Body = new BoxShaper(); m_SceneObjects[0]->AddComponent(l_Body); - MeshContainer * l_Mesh = new CubeMesh(); - m_SceneObjects[0]->AddComponent(l_Mesh); + //MeshContainer * l_Mesh = new CubeMesh(); + //m_SceneObjects[0]->AddComponent(l_Mesh); m_SceneObjects[0]->name = "Platform1"; //Sphere diff --git a/conanfile.py b/conanfile.py index 8608013..7ef7af6 100644 --- a/conanfile.py +++ b/conanfile.py @@ -103,9 +103,4 @@ def package(self): def package_info(self): self.cpp_info.set_property("cmake_target_name", "engine3d::engine3d") self.cpp_info.libs = ["engine3d"] - self.cpp_info.includedirs = ['./', './engine3d'] # Ordered list of include paths - - - - - + self.cpp_info.includedirs = ['./', './engine3d'] # Ordered list of include paths \ No newline at end of file diff --git a/sim_shader_transforms/engine3d/Core/API.hpp b/engine3d/Core/API.hpp similarity index 100% rename from sim_shader_transforms/engine3d/Core/API.hpp rename to engine3d/Core/API.hpp diff --git a/sim_shader_transforms/engine3d/Core/ApplicationInstance.hpp b/engine3d/Core/ApplicationInstance.hpp similarity index 100% rename from sim_shader_transforms/engine3d/Core/ApplicationInstance.hpp rename to engine3d/Core/ApplicationInstance.hpp diff --git a/sim_shader_transforms/engine3d/Core/ApplicationManager/GameObjManager/UUID.hpp b/engine3d/Core/ApplicationManager/GameObjManager/UUID.hpp similarity index 100% rename from sim_shader_transforms/engine3d/Core/ApplicationManager/GameObjManager/UUID.hpp rename to engine3d/Core/ApplicationManager/GameObjManager/UUID.hpp diff --git a/sim_shader_transforms/engine3d/Core/ApplicationManager/Scene.hpp b/engine3d/Core/ApplicationManager/Scene.hpp similarity index 100% rename from sim_shader_transforms/engine3d/Core/ApplicationManager/Scene.hpp rename to engine3d/Core/ApplicationManager/Scene.hpp diff --git a/sim_shader_transforms/engine3d/Core/ApplicationManager/ThreadMngr.hpp b/engine3d/Core/ApplicationManager/ThreadMngr.hpp similarity index 100% rename from sim_shader_transforms/engine3d/Core/ApplicationManager/ThreadMngr.hpp rename to engine3d/Core/ApplicationManager/ThreadMngr.hpp diff --git a/sim_shader_transforms/engine3d/Core/Core.hpp b/engine3d/Core/Core.hpp similarity index 100% rename from sim_shader_transforms/engine3d/Core/Core.hpp rename to engine3d/Core/Core.hpp diff --git a/sim_shader_transforms/engine3d/Core/EngineLogger.hpp b/engine3d/Core/EngineLogger.hpp similarity index 100% rename from sim_shader_transforms/engine3d/Core/EngineLogger.hpp rename to engine3d/Core/EngineLogger.hpp diff --git a/sim_shader_transforms/engine3d/Core/Event/Event.hpp b/engine3d/Core/Event/Event.hpp similarity index 100% rename from sim_shader_transforms/engine3d/Core/Event/Event.hpp rename to engine3d/Core/Event/Event.hpp diff --git a/sim_shader_transforms/engine3d/Core/Event/InputPoll.hpp b/engine3d/Core/Event/InputPoll.hpp similarity index 100% rename from sim_shader_transforms/engine3d/Core/Event/InputPoll.hpp rename to engine3d/Core/Event/InputPoll.hpp diff --git a/sim_shader_transforms/engine3d/Core/Event/KeyCodes.hpp b/engine3d/Core/Event/KeyCodes.hpp similarity index 100% rename from sim_shader_transforms/engine3d/Core/Event/KeyCodes.hpp rename to engine3d/Core/Event/KeyCodes.hpp diff --git a/sim_shader_transforms/engine3d/Core/Event/KeyEvent.hpp b/engine3d/Core/Event/KeyEvent.hpp similarity index 100% rename from sim_shader_transforms/engine3d/Core/Event/KeyEvent.hpp rename to engine3d/Core/Event/KeyEvent.hpp diff --git a/sim_shader_transforms/engine3d/Core/Event/MouseCodes.hpp b/engine3d/Core/Event/MouseCodes.hpp similarity index 100% rename from sim_shader_transforms/engine3d/Core/Event/MouseCodes.hpp rename to engine3d/Core/Event/MouseCodes.hpp diff --git a/sim_shader_transforms/engine3d/Core/Event/MouseEvent.hpp b/engine3d/Core/Event/MouseEvent.hpp similarity index 100% rename from sim_shader_transforms/engine3d/Core/Event/MouseEvent.hpp rename to engine3d/Core/Event/MouseEvent.hpp diff --git a/sim_shader_transforms/engine3d/Core/GraphicDrivers/GraphicContextDriver.hpp b/engine3d/Core/GraphicDrivers/GraphicContextDriver.hpp similarity index 100% rename from sim_shader_transforms/engine3d/Core/GraphicDrivers/GraphicContextDriver.hpp rename to engine3d/Core/GraphicDrivers/GraphicContextDriver.hpp diff --git a/sim_shader_transforms/engine3d/Core/GraphicDrivers/GraphicPhysicalDriver.hpp b/engine3d/Core/GraphicDrivers/GraphicPhysicalDriver.hpp similarity index 100% rename from sim_shader_transforms/engine3d/Core/GraphicDrivers/GraphicPhysicalDriver.hpp rename to engine3d/Core/GraphicDrivers/GraphicPhysicalDriver.hpp diff --git a/sim_shader_transforms/engine3d/Core/GraphicDrivers/GraphicSwapchain.hpp b/engine3d/Core/GraphicDrivers/GraphicSwapchain.hpp similarity index 100% rename from sim_shader_transforms/engine3d/Core/GraphicDrivers/GraphicSwapchain.hpp rename to engine3d/Core/GraphicDrivers/GraphicSwapchain.hpp diff --git a/sim_shader_transforms/engine3d/Core/GraphicDrivers/Shader.hpp b/engine3d/Core/GraphicDrivers/Shader.hpp similarity index 100% rename from sim_shader_transforms/engine3d/Core/GraphicDrivers/Shader.hpp rename to engine3d/Core/GraphicDrivers/Shader.hpp diff --git a/sim_shader_transforms/engine3d/Core/Renderer/Renderer.hpp b/engine3d/Core/Renderer/Renderer.hpp similarity index 100% rename from sim_shader_transforms/engine3d/Core/Renderer/Renderer.hpp rename to engine3d/Core/Renderer/Renderer.hpp diff --git a/sim_shader_transforms/engine3d/Core/Renderer/RendererSettings.hpp b/engine3d/Core/Renderer/RendererSettings.hpp similarity index 100% rename from sim_shader_transforms/engine3d/Core/Renderer/RendererSettings.hpp rename to engine3d/Core/Renderer/RendererSettings.hpp diff --git a/sim_shader_transforms/engine3d/Core/Scene/SceneObject.hpp b/engine3d/Core/Scene/SceneObject.hpp similarity index 100% rename from sim_shader_transforms/engine3d/Core/Scene/SceneObject.hpp rename to engine3d/Core/Scene/SceneObject.hpp diff --git a/sim_shader_transforms/engine3d/Core/SceneManagment/Components/GameComponent.hpp b/engine3d/Core/SceneManagment/Components/GameComponent.hpp similarity index 100% rename from sim_shader_transforms/engine3d/Core/SceneManagment/Components/GameComponent.hpp rename to engine3d/Core/SceneManagment/Components/GameComponent.hpp diff --git a/sim_shader_transforms/engine3d/Core/SceneManagment/Components/SPComps/Transform.hpp b/engine3d/Core/SceneManagment/Components/SPComps/Transform.hpp similarity index 100% rename from sim_shader_transforms/engine3d/Core/SceneManagment/Components/SPComps/Transform.hpp rename to engine3d/Core/SceneManagment/Components/SPComps/Transform.hpp diff --git a/sim_shader_transforms/engine3d/Core/SceneManagment/SceneObjects/SceneObject.hpp b/engine3d/Core/SceneManagment/SceneObjects/SceneObject.hpp similarity index 100% rename from sim_shader_transforms/engine3d/Core/SceneManagment/SceneObjects/SceneObject.hpp rename to engine3d/Core/SceneManagment/SceneObjects/SceneObject.hpp diff --git a/sim_shader_transforms/engine3d/Core/TimeManagement/GlobalUpdateManager.hpp b/engine3d/Core/TimeManagement/GlobalUpdateManager.hpp similarity index 100% rename from sim_shader_transforms/engine3d/Core/TimeManagement/GlobalUpdateManager.hpp rename to engine3d/Core/TimeManagement/GlobalUpdateManager.hpp diff --git a/sim_shader_transforms/engine3d/Core/TimeManagement/Timer.hpp b/engine3d/Core/TimeManagement/Timer.hpp similarity index 100% rename from sim_shader_transforms/engine3d/Core/TimeManagement/Timer.hpp rename to engine3d/Core/TimeManagement/Timer.hpp diff --git a/sim_shader_transforms/engine3d/Core/TimeManagement/UpdateManagers/ParallelFrameUpdateManager.hpp b/engine3d/Core/TimeManagement/UpdateManagers/ParallelFrameUpdateManager.hpp similarity index 100% rename from sim_shader_transforms/engine3d/Core/TimeManagement/UpdateManagers/ParallelFrameUpdateManager.hpp rename to engine3d/Core/TimeManagement/UpdateManagers/ParallelFrameUpdateManager.hpp diff --git a/sim_shader_transforms/engine3d/Core/TimeManagement/UpdateManagers/SyncUpdateManager.hpp b/engine3d/Core/TimeManagement/UpdateManagers/SyncUpdateManager.hpp similarity index 100% rename from sim_shader_transforms/engine3d/Core/TimeManagement/UpdateManagers/SyncUpdateManager.hpp rename to engine3d/Core/TimeManagement/UpdateManagers/SyncUpdateManager.hpp diff --git a/sim_shader_transforms/engine3d/Core/Timestep.hpp b/engine3d/Core/Timestep.hpp similarity index 100% rename from sim_shader_transforms/engine3d/Core/Timestep.hpp rename to engine3d/Core/Timestep.hpp diff --git a/sim_shader_transforms/engine3d/Core/Window.hpp b/engine3d/Core/Window.hpp similarity index 100% rename from sim_shader_transforms/engine3d/Core/Window.hpp rename to engine3d/Core/Window.hpp diff --git a/sim_shader_transforms/engine3d/Core/internal/CoreInternal.hpp b/engine3d/Core/internal/CoreInternal.hpp similarity index 100% rename from sim_shader_transforms/engine3d/Core/internal/CoreInternal.hpp rename to engine3d/Core/internal/CoreInternal.hpp diff --git a/sim_shader_transforms/engine3d/Core/internal/FrameTimer.hpp b/engine3d/Core/internal/FrameTimer.hpp similarity index 100% rename from sim_shader_transforms/engine3d/Core/internal/FrameTimer.hpp rename to engine3d/Core/internal/FrameTimer.hpp diff --git a/sim_shader_transforms/engine3d/Core/internal/Serializer.hpp b/engine3d/Core/internal/Serializer.hpp similarity index 100% rename from sim_shader_transforms/engine3d/Core/internal/Serializer.hpp rename to engine3d/Core/internal/Serializer.hpp diff --git a/sim_shader_transforms/engine3d/Core/internal/Vulkan2Showcase/Shaders/ShaderPipelineConfig.hpp b/engine3d/Core/internal/Vulkan2Showcase/Shaders/ShaderPipelineConfig.hpp similarity index 100% rename from sim_shader_transforms/engine3d/Core/internal/Vulkan2Showcase/Shaders/ShaderPipelineConfig.hpp rename to engine3d/Core/internal/Vulkan2Showcase/Shaders/ShaderPipelineConfig.hpp diff --git a/sim_shader_transforms/engine3d/Core/internal/Vulkan2Showcase/Shaders/ShaderSpirvBins.hpp b/engine3d/Core/internal/Vulkan2Showcase/Shaders/ShaderSpirvBins.hpp similarity index 100% rename from sim_shader_transforms/engine3d/Core/internal/Vulkan2Showcase/Shaders/ShaderSpirvBins.hpp rename to engine3d/Core/internal/Vulkan2Showcase/Shaders/ShaderSpirvBins.hpp diff --git a/sim_shader_transforms/engine3d/Core/internal/Vulkan2Showcase/Shaders/VulkanShader.hpp b/engine3d/Core/internal/Vulkan2Showcase/Shaders/VulkanShader.hpp similarity index 100% rename from sim_shader_transforms/engine3d/Core/internal/Vulkan2Showcase/Shaders/VulkanShader.hpp rename to engine3d/Core/internal/Vulkan2Showcase/Shaders/VulkanShader.hpp diff --git a/sim_shader_transforms/engine3d/Core/internal/Vulkan2Showcase/Vulkan.hpp b/engine3d/Core/internal/Vulkan2Showcase/Vulkan.hpp similarity index 100% rename from sim_shader_transforms/engine3d/Core/internal/Vulkan2Showcase/Vulkan.hpp rename to engine3d/Core/internal/Vulkan2Showcase/Vulkan.hpp diff --git a/sim_shader_transforms/engine3d/Core/internal/Vulkan2Showcase/VulkanContext.hpp b/engine3d/Core/internal/Vulkan2Showcase/VulkanContext.hpp similarity index 100% rename from sim_shader_transforms/engine3d/Core/internal/Vulkan2Showcase/VulkanContext.hpp rename to engine3d/Core/internal/Vulkan2Showcase/VulkanContext.hpp diff --git a/sim_shader_transforms/engine3d/Core/internal/Vulkan2Showcase/VulkanDriver.hpp b/engine3d/Core/internal/Vulkan2Showcase/VulkanDriver.hpp similarity index 100% rename from sim_shader_transforms/engine3d/Core/internal/Vulkan2Showcase/VulkanDriver.hpp rename to engine3d/Core/internal/Vulkan2Showcase/VulkanDriver.hpp diff --git a/sim_shader_transforms/engine3d/Core/internal/Vulkan2Showcase/VulkanModel.hpp b/engine3d/Core/internal/Vulkan2Showcase/VulkanModel.hpp similarity index 84% rename from sim_shader_transforms/engine3d/Core/internal/Vulkan2Showcase/VulkanModel.hpp rename to engine3d/Core/internal/Vulkan2Showcase/VulkanModel.hpp index bf3bb4c..558ff1c 100644 --- a/sim_shader_transforms/engine3d/Core/internal/Vulkan2Showcase/VulkanModel.hpp +++ b/engine3d/Core/internal/Vulkan2Showcase/VulkanModel.hpp @@ -1,4 +1,5 @@ #pragma once +#include #include #include @@ -30,7 +31,9 @@ namespace engine3d::vk{ void Bind(VkCommandBuffer p_Command); void Draw(VkCommandBuffer p_Command); - + static std::vector* CreateVertexVector(std::vector p_Vertices, std::vector p_Colors); + static std::vector* CreateVertexVector(std::vector p_Vertices); + private: void initialize_vertex_buffers(const std::vector& p_Vertices); diff --git a/sim_shader_transforms/engine3d/Core/internal/Vulkan2Showcase/VulkanPhysicalDriver.hpp b/engine3d/Core/internal/Vulkan2Showcase/VulkanPhysicalDriver.hpp similarity index 100% rename from sim_shader_transforms/engine3d/Core/internal/Vulkan2Showcase/VulkanPhysicalDriver.hpp rename to engine3d/Core/internal/Vulkan2Showcase/VulkanPhysicalDriver.hpp diff --git a/sim_shader_transforms/engine3d/Core/internal/Vulkan2Showcase/VulkanSwapchain.hpp b/engine3d/Core/internal/Vulkan2Showcase/VulkanSwapchain.hpp similarity index 100% rename from sim_shader_transforms/engine3d/Core/internal/Vulkan2Showcase/VulkanSwapchain.hpp rename to engine3d/Core/internal/Vulkan2Showcase/VulkanSwapchain.hpp diff --git a/sim_shader_transforms/engine3d/Core/internal/Vulkan2Showcase/VulkanWindow.hpp b/engine3d/Core/internal/Vulkan2Showcase/VulkanWindow.hpp similarity index 100% rename from sim_shader_transforms/engine3d/Core/internal/Vulkan2Showcase/VulkanWindow.hpp rename to engine3d/Core/internal/Vulkan2Showcase/VulkanWindow.hpp diff --git a/sim_shader_transforms/engine3d/Core/internal/Vulkan2Showcase/helper_functions.hpp b/engine3d/Core/internal/Vulkan2Showcase/helper_functions.hpp similarity index 100% rename from sim_shader_transforms/engine3d/Core/internal/Vulkan2Showcase/helper_functions.hpp rename to engine3d/Core/internal/Vulkan2Showcase/helper_functions.hpp diff --git a/sim_shader_transforms/engine3d/Math/Interpolation.hpp b/engine3d/Math/Interpolation.hpp similarity index 100% rename from sim_shader_transforms/engine3d/Math/Interpolation.hpp rename to engine3d/Math/Interpolation.hpp diff --git a/sim_shader_transforms/engine3d/Physics/Interaction/Engine3DActivationListener.hpp b/engine3d/Physics/Interaction/Engine3DActivationListener.hpp similarity index 100% rename from sim_shader_transforms/engine3d/Physics/Interaction/Engine3DActivationListener.hpp rename to engine3d/Physics/Interaction/Engine3DActivationListener.hpp diff --git a/sim_shader_transforms/engine3d/Physics/Interaction/Engine3DContactListener.hpp b/engine3d/Physics/Interaction/Engine3DContactListener.hpp similarity index 100% rename from sim_shader_transforms/engine3d/Physics/Interaction/Engine3DContactListener.hpp rename to engine3d/Physics/Interaction/Engine3DContactListener.hpp diff --git a/sim_shader_transforms/engine3d/Physics/Interfaces/BPLayerInterfaceHandler.hpp b/engine3d/Physics/Interfaces/BPLayerInterfaceHandler.hpp similarity index 100% rename from sim_shader_transforms/engine3d/Physics/Interfaces/BPLayerInterfaceHandler.hpp rename to engine3d/Physics/Interfaces/BPLayerInterfaceHandler.hpp diff --git a/sim_shader_transforms/engine3d/Physics/Interfaces/ObjectLayerPairFilterInterface.hpp b/engine3d/Physics/Interfaces/ObjectLayerPairFilterInterface.hpp similarity index 100% rename from sim_shader_transforms/engine3d/Physics/Interfaces/ObjectLayerPairFilterInterface.hpp rename to engine3d/Physics/Interfaces/ObjectLayerPairFilterInterface.hpp diff --git a/sim_shader_transforms/engine3d/Physics/Interfaces/ObjectVsBPLayerFilterInterface.hpp b/engine3d/Physics/Interfaces/ObjectVsBPLayerFilterInterface.hpp similarity index 100% rename from sim_shader_transforms/engine3d/Physics/Interfaces/ObjectVsBPLayerFilterInterface.hpp rename to engine3d/Physics/Interfaces/ObjectVsBPLayerFilterInterface.hpp diff --git a/sim_shader_transforms/engine3d/Physics/JoltHandler.hpp b/engine3d/Physics/JoltHandler.hpp similarity index 100% rename from sim_shader_transforms/engine3d/Physics/JoltHandler.hpp rename to engine3d/Physics/JoltHandler.hpp diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 33489da..88ec64d 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -9,7 +9,7 @@ set(VULKAN_SHADERS_SRC_DIR ${VULKAN_SRC_DIR}/Shaders) build_library( SOURCES - ${ENGINE_INCLUDE_NAME}/Core/ApplicationInstance.hpp + ${ENGINE_SRC_DIR}/Core/ApplicationInstance.cpp ${ENGINE_INCLUDE_NAME}/Core/EngineLogger.hpp ${ENGINE_INCLUDE_NAME}/Core/Window.hpp @@ -55,10 +55,6 @@ build_library( ${ENGINE_INCLUDE_NAME}/Core/SceneManagment/SceneObjects/SceneObject.hpp ${ENGINE_INCLUDE_NAME}/Core/ApplicationManager/GameObjManager/UUID.hpp - # ${ENGINE_INCLUDE_NAME}/src/Scenes/Assets/Components/Graphics/Meshes/ChildrenMeshes - # ${ENGINE_SRC_DIR}/src/Scenes/Assets/Components/Graphics/Meshes/ChildrenMeshes/SphereMesh.cpp - # ${ENGINE_INCLUDE_NAME}/src/Scenes/Assets/Components/Graphics/Meshes/ChildrenMeshes/CubeMesh.cpp - # Special Component Includes ${ENGINE_INCLUDE_NAME}/Core/SceneManagment/Components/SPComps/Transform.hpp @@ -113,4 +109,4 @@ build_library( ${ENGINE_SRC_DIR}/Math/Interpolation.cpp ${ENGINE_SRC_DIR}/Physics/JoltHandler.cpp -) +) \ No newline at end of file diff --git a/src/engine3d/Core/TimeManagement/GlobalUpdateManager.cpp b/src/engine3d/Core/TimeManagement/GlobalUpdateManager.cpp index 4ecd224..d90def8 100644 --- a/src/engine3d/Core/TimeManagement/GlobalUpdateManager.cpp +++ b/src/engine3d/Core/TimeManagement/GlobalUpdateManager.cpp @@ -4,6 +4,7 @@ #include #include #include +#include #include #include #include @@ -33,7 +34,7 @@ namespace engine3d m_GlobalDeltaTime = 0.0; m_UpdateTime = m_GlobalTimer->GetCurrentTime(); - m_MaxFPS = 90; + m_MaxFPS = 1000;//std::numeric_limits::max(); m_FPSCounter = 1; //! @note syncupdatemanager will not work until the thread manager works. diff --git a/src/engine3d/Core/internal/Vulkan2Showcase/VulkanModel.cpp b/src/engine3d/Core/internal/Vulkan2Showcase/VulkanModel.cpp index 8524b61..8435b27 100644 --- a/src/engine3d/Core/internal/Vulkan2Showcase/VulkanModel.cpp +++ b/src/engine3d/Core/internal/Vulkan2Showcase/VulkanModel.cpp @@ -2,6 +2,7 @@ #include #include #include +#include #include namespace engine3d::vk{ @@ -105,4 +106,31 @@ namespace engine3d::vk{ return attribute_description; } + std::vector* VulkanModel::CreateVertexVector + (std::vector p_Vertices, std::vector p_Colors) + { + std::vector* temp = new std::vector; + int i = 0; + for(auto verticies : p_Vertices) + { + //! if does not work vertex needs a constructor + temp[i].push_back(VulkanModel::Vertex(p_Vertices[i], p_Colors[i])); + i++; + } + return temp; + } + + std::vector* VulkanModel::CreateVertexVector + (std::vector p_Vertices) + { + std::vector* temp = new std::vector; + int i = 0; + for(auto verticies : p_Vertices) + { + //! if does not work vertex needs a constructor + temp[i].push_back(VulkanModel::Vertex(p_Vertices[i], {1.0f,1.0f,1.0f})); + i++; + } + return temp; + } }; \ No newline at end of file