-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* build: successful editor build * Pushing MeshChanges
- Loading branch information
1 parent
3adf7fe
commit 02bbc49
Showing
74 changed files
with
357 additions
and
151 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,79 +1,76 @@ | ||
cmake_minimum_required(VERSION 3.15) | ||
project(TestApp CXX) | ||
|
||
|
||
# find_package(Vulkan REQUIRED) | ||
|
||
# find_package(engine3d CONFIG REQUIRED) | ||
add_executable(${PROJECT_NAME} | ||
Application.cpp | ||
|
||
#To Test | ||
SceneTest/Scenes/Assets/Components/testComp.hpp | ||
SceneTest/src/Scenes/Assets/Components/testComp.cpp | ||
Scenes/Assets/Components/testComp.hpp | ||
src/Scenes/Assets/Components/testComp.cpp | ||
|
||
#Physics | ||
SceneTest/Scenes/Assets/Components/Physics/PhysicsBody3D.hpp | ||
SceneTest/src/Scenes/Assets/Components/Physics/PhysicsBody3D.cpp | ||
Scenes/Assets/Components/Physics/PhysicsBody3D.hpp | ||
src/Scenes/Assets/Components/Physics/PhysicsBody3D.cpp | ||
|
||
SceneTest/Scenes/Assets/Components/Bodies/BodyContainer.hpp | ||
SceneTest/src/Scenes/Assets/Components/Bodies/BodyContainer.cpp | ||
Scenes/Assets/Components/Bodies/BodyContainer.hpp | ||
src/Scenes/Assets/Components/Bodies/BodyContainer.cpp | ||
|
||
|
||
#Body Shapes | ||
SceneTest/Scenes/Assets/Components/Bodies/Shapes/BoxShaper.hpp | ||
SceneTest/src/Scenes/Assets/Components/Bodies/Shapes/BoxShaper.cpp | ||
Scenes/Assets/Components/Bodies/Shapes/BoxShaper.hpp | ||
src/Scenes/Assets/Components/Bodies/Shapes/BoxShaper.cpp | ||
|
||
SceneTest/Scenes/Assets/Components/Bodies/Shapes/SphereShaper.hpp | ||
SceneTest/src/Scenes/Assets/Components/Bodies/Shapes/SphereShaper.cpp | ||
Scenes/Assets/Components/Bodies/Shapes/SphereShaper.hpp | ||
src/Scenes/Assets/Components/Bodies/Shapes/SphereShaper.cpp | ||
|
||
#Scenes | ||
SceneTest/Scenes/Assets/SceneInstances/ShowCaseSceneInstance.hpp | ||
SceneTest/src/Scenes/Assets/SceneInstances/ShowCaseSceneInstance.cpp | ||
|
||
Scenes/Assets/SceneInstances/ShowCaseSceneInstance.hpp | ||
src/Scenes/Assets/SceneInstances/ShowCaseSceneInstance.cpp | ||
|
||
#Graphics | ||
Scenes/Assets/Components/Graphics/SpriteRender3D.hpp | ||
src/Scenes/Assets/Components/Graphics/SpriteRender3D.cpp | ||
|
||
#Graphics Meshes ChildrenMeshes | ||
Scenes/Assets/Components/Graphics/Meshes/ChildrenMeshes/CubeMesh.hpp | ||
src/Scenes/Assets/Components/Graphics/Meshes/ChildrenMeshes/CubeMesh.cpp | ||
Scenes/Assets/Components/Graphics/Meshes/ChildrenMeshes/SphereMesh.hpp | ||
# src/Scenes/Assets/Components/Graphics/Meshes/ChildrenMeshes/SphereMesh.cpp | ||
src/Scenes/Assets/Components/Graphics/Meshes/ChildrenMeshes/SphereMesh.cpp | ||
Scenes/Assets/Components/Graphics/Meshes/MeshContainer.hpp | ||
src/Scenes/Assets/Components/Graphics/Meshes/MeshContainer.cpp | ||
|
||
) | ||
) | ||
|
||
target_include_directories(${PROJECT_NAME} PUBLIC SceneTest) | ||
target_include_directories(${PROJECT_NAME} PUBLIC ./ SceneTest) | ||
target_include_directories(${PROJECT_NAME} PRIVATE ../) | ||
|
||
target_compile_definitions(${PROJECT_NAME} PRIVATE ${dev_definitions}) | ||
|
||
find_package(OpenGL REQUIRED) | ||
find_package(glfw3 REQUIRED) | ||
|
||
find_package(Vulkan REQUIRED) | ||
find_package(VulkanHeaders REQUIRED) | ||
|
||
if(LINUX) | ||
find_package(VulkanLoader REQUIRED) | ||
endif(LINUX) | ||
|
||
# target_include_directories(${PROJECT_NAME} PUBLIC ${ENGINE_INCLUDE_DIR}) | ||
target_include_directories(${PROJECT_NAME} PRIVATE ../) | ||
find_package(glm REQUIRED) | ||
find_package(fmt REQUIRED) | ||
find_package(spdlog REQUIRED) | ||
find_package(glm REQUIRED) | ||
find_package(yaml-cpp REQUIRED) | ||
find_package(imguidocking REQUIRED) | ||
find_package(box2d REQUIRED) | ||
find_package(Vulkan REQUIRED) | ||
find_package(joltphysics REQUIRED) | ||
find_package(EnTT REQUIRED) | ||
find_package(imguidocking REQUIRED) | ||
|
||
|
||
target_link_libraries( | ||
${PROJECT_NAME} | ||
PRIVATE | ||
glfw | ||
${OPENGL_LIBRARIES} | ||
Vulkan::Vulkan | ||
vulkan-headers::vulkan-headers | ||
glm::glm | ||
fmt::fmt | ||
spdlog::spdlog | ||
glm::glm | ||
yaml-cpp::yaml-cpp | ||
imguidocking::imguidocking | ||
box2d::box2d | ||
Vulkan::Vulkan | ||
Jolt::Jolt | ||
EnTT::EnTT | ||
imguidocking::imguidocking | ||
engine3d | ||
) |
111 changes: 0 additions & 111 deletions
111
TestApp/SceneTest/src/Scenes/Assets/Components/Physics/PhysicsBody3D.cpp
This file was deleted.
Oops, something went wrong.
File renamed without changes.
File renamed without changes.
File renamed without changes.
8 changes: 8 additions & 0 deletions
8
TestApp/Scenes/Assets/Components/Graphics/Meshes/ChildrenMeshes/CubeMesh.hpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
#pragma once | ||
class CubeMesh | ||
{ | ||
public: | ||
CubeMesh(); | ||
void Draw(); | ||
|
||
}; |
14 changes: 14 additions & 0 deletions
14
TestApp/Scenes/Assets/Components/Graphics/Meshes/ChildrenMeshes/SphereMesh.hpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
#pragma once | ||
#include "Core/SceneManagment/Components/GameComponent.hpp" | ||
#include "Scenes/Assets/Components/Physics/PhysicsBody3D.hpp" | ||
|
||
class SphereMesh : public engine3d::GameComponent | ||
{ | ||
public: | ||
SphereMesh(int Radius, int SectorCount, int StackCount) | ||
void CreateSphere(); | ||
|
||
private: | ||
engine3d::Transform m_Transform; | ||
glm::vec3* m_TransformPosition; | ||
}; |
17 changes: 17 additions & 0 deletions
17
TestApp/Scenes/Assets/Components/Graphics/Meshes/MeshContainer.hpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
#include <Scenes/Assets/Components/Physics/PhysicsBody3D.hpp> | ||
#include <Scenes/Assets/Components/Graphics/Meshes/ChildrenMeshes/SphereMesh.hpp> | ||
#include <Scenes/Assets/Components/Graphics/Meshes/ChildrenMeshes/CubeMesh.hpp> | ||
|
||
//! @brief Factory | ||
class MeshContainer | ||
{ | ||
public: | ||
MeshContainer(); | ||
|
||
|
||
private: | ||
|
||
std::vector<glm::vec3> vertices; | ||
std::vector<glm::vec3> normals; | ||
std::vector<glm::vec2> texCoords; | ||
}; |
22 changes: 22 additions & 0 deletions
22
TestApp/Scenes/Assets/Components/Graphics/SpriteRender3D.hpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
|
||
#include <Core/SceneManagment/Components/GameComponent.hpp> | ||
#include <Scenes/Assets/Components/Physics/PhysicsBody3D.hpp> | ||
#include <Scenes/Assets/Components/Graphics/Meshes/MeshContainer.hpp> | ||
|
||
class SpriteRender3D : public engine3d::GameComponent | ||
{ | ||
public: | ||
SpriteRender3D(MeshContainer* meshBody); | ||
void OnIntegrate(); | ||
void Update(); | ||
void LateUpdate(); | ||
void PhysicsUpdate(); | ||
std::vector<glm::vec3> vertices; | ||
std::vector<glm::vec3> normals; | ||
std::vector<glm::vec2> texCoords; | ||
|
||
private: | ||
MeshContainer m_MeshContainer; | ||
engine3d::Transform m_Transform; | ||
glm::vec3* m_TransformPosition; | ||
}; |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
63 changes: 63 additions & 0 deletions
63
TestApp/src/Scenes/Assets/Components/Graphics/Meshes/ChildrenMeshes/CubeMesh.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
#include <Scenes/Assets/Components/Graphics/Meshes/ChildrenMeshes/CubeMesh.hpp> | ||
#include <Scenes/Assets/Components/Graphics/Meshes/ChildrenMeshes/CubeMesh.hpp> | ||
#include <vulkan/vulkan_core.h> | ||
|
||
void CubeMesh::Draw() | ||
{ | ||
Ref<vk::VulkanModel> CreateCubeMesh(glm::vec3 offset){ | ||
std::vector<vk::VulkanModel::Vertex> 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}}, | ||
}; | ||
|
||
for (auto& v : vertices) { | ||
v.Position += offset; | ||
} | ||
return CreateRef<vk::VulkanModel>(vertices, VK_BUFFER_USAGE_VERTEX_BUFFER_BIT, VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT | VK_MEMORY_PROPERTY_HOST_COHERENT_BIT); | ||
} | ||
} |
10 changes: 10 additions & 0 deletions
10
TestApp/src/Scenes/Assets/Components/Graphics/Meshes/ChildrenMeshes/SphereMesh.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
// #include "Core/EngineLogger.hpp" | ||
// #include <TestApp/SceneTest/Scenes/Assets/Components/Graphics/Meshes/ChildrenMeshes/SphereMesh.hpp> | ||
// #include <numbers> | ||
#include <Scenes/Assets/Components/Graphics/Meshes/ChildrenMeshes/SphereMesh.hpp> | ||
using namespace engine3d; | ||
|
||
void SphereMesh::CreateSphere(){ | ||
m_Transform = m_GameObjectRef->SceneGetComponent<Transform>(); | ||
m_TransformPosition = &m_Transform.m_Position; | ||
} |
Oops, something went wrong.