Skip to content

Commit

Permalink
Framework structure refactoring.
Browse files Browse the repository at this point in the history
  • Loading branch information
edisonlee0212 committed Sep 5, 2024
1 parent 0f729cc commit ca92afe
Show file tree
Hide file tree
Showing 167 changed files with 974 additions and 1,042 deletions.
10 changes: 9 additions & 1 deletion EvoEngine_App/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
add_subdirectory(Demo)
add_subdirectory(EcoSysLab)
add_subdirectory(TextureBaking)
add_subdirectory(DigitalAgriculture)
add_subdirectory(DatasetGeneration)

set_property(TARGET DemoApp PROPERTY FOLDER "Apps")
set_property(TARGET EcoSysLabApp PROPERTY FOLDER "Apps")
set_property(TARGET LogGraderApp PROPERTY FOLDER "Apps")
set_property(TARGET DatasetGeneratorApp PROPERTY FOLDER "Apps")

set_property(TARGET DigitalAgricultureApp PROPERTY FOLDER "Apps")
34 changes: 34 additions & 0 deletions EvoEngine_App/DatasetGeneration/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
if (${CMAKE_BINARY_DIR} STREQUAL ${PROJECT_BINARY_DIR} AND EVOENGINE_PLUGIN_ECOSYSLAB AND EVOENGINE_PLUGIN_DATASET_GENERATION)
option(DATASET_GENERATOR_APPLICATION "Build DatasetGenerator application" ON)
if(DATASET_GENERATOR_APPLICATION)
set(DEFAULT_PROJECT_DIR ${CMAKE_CURRENT_SOURCE_DIR}/Resources/EcoSysLabProject/)
set(DEFAULT_PROJECT_DEF DATASET_GENERATOR_DEFAULT_PROJECT_FOLDER=\"${DEFAULT_PROJECT_DIR}\")

add_executable(DatasetGeneratorApp
DatasetGeneratorApp.cpp)

target_compile_definitions(DatasetGeneratorApp
PRIVATE
${DEFAULT_PROJECT_DEF}
${EVOENGINE_DEFS}
)
target_include_directories(DatasetGeneratorApp
PRIVATE
${EVOENGINE_INCLUDES}
)

target_precompile_headers(DatasetGeneratorApp
PRIVATE
${EVOENGINE_PCHS}
)

target_link_libraries(DatasetGeneratorApp
PRIVATE
EvoEngine_SDK
${EvoEngine_Plugins}
)

file(COPY imgui.ini DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
evoengine_copy_resources(DatasetGeneratorApp ${CMAKE_CURRENT_BINARY_DIR})
endif ()
endif ()
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@
#include "ParticlePhysics2DDemo.hpp"
#include "Physics2DDemo.hpp"
using namespace eco_sys_lab;
using namespace digital_agriculture;
using namespace dataset_generation;
void register_classes() {
PrivateComponentRegistration<ObjectRotator>("ObjectRotator");
PrivateComponentRegistration<Physics2DDemo>("Physics2DDemo");
Expand Down
154 changes: 154 additions & 0 deletions EvoEngine_App/DatasetGeneration/imgui.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,154 @@
[Window][Root DockSpace]
Pos=0,25
Size=1280,694
Collapsed=0

[Window][Debug##Default]
Pos=60,31
Size=400,400
Collapsed=0

[Window][Camera (Ray)]
Pos=323,19
Size=863,1195
Collapsed=0
DockId=0x0000000F,1

[Window][Entity Explorer]
Pos=0,25
Size=199,694
Collapsed=0
DockId=0x00000002,0

[Window][Entity Inspector]
Pos=923,25
Size=357,348
Collapsed=0
DockId=0x0000000C,0

[Window][Camera]
Pos=323,19
Size=541,546
Collapsed=0
DockId=0x0000000F,0

[Window][Scene]
Pos=201,25
Size=720,467
Collapsed=0
DockId=0x0000000F,0

[Window][Project]
Pos=201,494
Size=720,225
Collapsed=0
DockId=0x00000008,1

[Window][Asset Inspector]
Pos=1908,19
Size=652,678
Collapsed=0
DockId=0x0000000C,0

[Window][Console]
Pos=201,494
Size=720,225
Collapsed=0
DockId=0x00000008,0

[Window][Ray Tracer Manager]
Pos=0,19
Size=321,701
Collapsed=0
DockId=0x00000002,1

[Window][Scene (Ray)]
Pos=612,19
Size=1540,1195
Collapsed=0
DockId=0x0000000E,0

[Window][Tree Hierarchy]
Pos=866,437
Size=189,283
Collapsed=0
DockId=0x00000006,0

[Window][Node Inspector]
Pos=1057,437
Size=223,283
Collapsed=0
DockId=0x00000009,0

[Window][Tree Inspector]
Pos=1908,699
Size=652,670
Collapsed=0
DockId=0x0000000B,1

[Window][EcoSysLab Layer]
Pos=923,375
Size=357,344
Collapsed=0
DockId=0x0000000B,0

[Window][Sorghum Layer]
Pos=1908,699
Size=652,670
Collapsed=0
DockId=0x0000000B,1

[Window][Plant Visual]
Pos=201,25
Size=720,467
Collapsed=0
DockId=0x0000000F,1

[Window][Choose Project##ChooseProjectKey]
Size=800,600
Collapsed=0
DockId=0x0000000F,0

[Window][Front Profile]
Pos=224,744
Size=768,470
Collapsed=0
DockId=0x00000013,0

[Window][Scene (RT)]
Pos=994,19
Size=912,1195
Collapsed=0
DockId=0x00000012,0

[Window][Assets]
Pos=923,375
Size=357,344
Collapsed=0
DockId=0x0000000B,1

[Table][0x2FED61BF,4]
RefScale=13
Column 0 Sort=0v

[Docking][Data]
DockSpace ID=0xF6D6C6EC Window=0x1974F89A Pos=0,25 Size=1280,694 Split=X
DockNode ID=0x00000004 Parent=0xF6D6C6EC SizeRef=921,1350 Split=X Selected=0xE192E354
DockNode ID=0x00000002 Parent=0x00000004 SizeRef=199,1350 Selected=0x7E27A297
DockNode ID=0x00000003 Parent=0x00000004 SizeRef=720,1350 Split=Y Selected=0xE192E354
DockNode ID=0x00000007 Parent=0x00000003 SizeRef=1719,467 Split=X Selected=0xE192E354
DockNode ID=0x0000000D Parent=0x00000007 SizeRef=386,1195 Split=X Selected=0x8893D423
DockNode ID=0x00000011 Parent=0x0000000D SizeRef=768,598 Split=Y Selected=0x8893D423
DockNode ID=0x0000000F Parent=0x00000011 SizeRef=841,723 CentralNode=1 Selected=0x8893D423
DockNode ID=0x00000013 Parent=0x00000011 SizeRef=841,470 Selected=0xDFC3ADA0
DockNode ID=0x00000012 Parent=0x0000000D SizeRef=912,598 Selected=0x5311940D
DockNode ID=0x0000000E Parent=0x00000007 SizeRef=1540,1195 Selected=0x4F7F92C6
DockNode ID=0x00000008 Parent=0x00000003 SizeRef=1719,225 Selected=0xD04A4B96
DockNode ID=0x00000005 Parent=0xF6D6C6EC SizeRef=357,1350 Split=Y Selected=0x60AF69E6
DockNode ID=0x00000001 Parent=0x00000005 SizeRef=801,416 Split=Y Selected=0xBE093A94
DockNode ID=0x0000000C Parent=0x00000001 SizeRef=414,678 Selected=0x60AF69E6
DockNode ID=0x0000000B Parent=0x00000001 SizeRef=414,670 Selected=0x26CE0345
DockNode ID=0x0000000A Parent=0x00000005 SizeRef=801,283 Split=X Selected=0x914E4099
DockNode ID=0x00000006 Parent=0x0000000A SizeRef=189,673 Selected=0x914E4099
DockNode ID=0x00000009 Parent=0x0000000A SizeRef=223,673 Selected=0xA55888DB

27 changes: 0 additions & 27 deletions EvoEngine_App/Demo/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,30 +3,6 @@ if (${CMAKE_BINARY_DIR} STREQUAL ${PROJECT_BINARY_DIR})
if(EVOENGINE_BUILD_APP_DEMO)
set(DEFAULT_PROJECT_DIR ${CMAKE_CURRENT_SOURCE_DIR}/Resources/TestingProject/)
set(DEFAULT_PROJECT_DEF EVOENGINE_DEFAULT_PROJECT_FOLDER=\"${DEFAULT_PROJECT_DIR}\")

file(GLOB PLANET_SOURCES_LOCAL ${CMAKE_CURRENT_SOURCE_DIR}/Planet/src/*.cpp)
file(GLOB STAR_CLUSTER_SOURCES_LOCAL ${CMAKE_CURRENT_SOURCE_DIR}/StarCluster/src/*.cpp)
add_library(Universe
STATIC
${PLANET_SOURCES_LOCAL}
${STAR_CLUSTER_SOURCES_LOCAL}
)
target_precompile_headers(Universe
PRIVATE
${EVOENGINE_PCHS}
)
target_include_directories(Universe
PRIVATE
${EVOENGINE_INCLUDES}
${CMAKE_CURRENT_SOURCE_DIR}/Planet/include
${CMAKE_CURRENT_SOURCE_DIR}/StarCluster/include
)
target_compile_definitions(Universe
PRIVATE
${DEFAULT_PROJECT_DEF}
${EVOENGINE_DEFS}
)

add_executable(DemoApp
Demo.cpp
)
Expand All @@ -38,8 +14,6 @@ if (${CMAKE_BINARY_DIR} STREQUAL ${PROJECT_BINARY_DIR})
target_include_directories(DemoApp
PRIVATE
${EVOENGINE_INCLUDES}
${CMAKE_CURRENT_SOURCE_DIR}/Planet/include
${CMAKE_CURRENT_SOURCE_DIR}/StarCluster/include
)
target_precompile_headers(DemoApp
PRIVATE
Expand All @@ -48,7 +22,6 @@ if (${CMAKE_BINARY_DIR} STREQUAL ${PROJECT_BINARY_DIR})
target_link_libraries(DemoApp
EvoEngine_SDK
${EvoEngine_Plugins}
Universe
)
file(COPY imgui.ini DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
evoengine_copy_resources(DemoApp ${CMAKE_CURRENT_BINARY_DIR})
Expand Down
35 changes: 23 additions & 12 deletions EvoEngine_App/Demo/Demo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,20 @@

#include "EditorLayer.hpp"
#include "MeshRenderer.hpp"
#include "PerlinNoiseStage.hpp"
#include "PlanetTerrainSystem.hpp"

#include "PlayerController.hpp"
#include "Prefab.hpp"
#include "RenderLayer.hpp"
#include "StarClusterSystem.hpp"

#include "Times.hpp"
#include "WindowLayer.hpp"

#ifdef UNIVERSE_PLUGIN
#include "PerlinNoiseStage.hpp"
#include "PlanetTerrainSystem.hpp"
#include "StarClusterSystem.hpp"
#endif

#include "PostProcessingStack.hpp"
#include "Resources.hpp"
#ifdef OPTIX_RAY_TRACER_PLUGIN
Expand All @@ -27,8 +32,8 @@
# include "CpuRayTracerCamera.hpp"
#endif
using namespace evo_engine;
using namespace planet;
using namespace Galaxy;
using namespace Universe;
using namespace Universe;
#pragma region Helpers
#ifdef PHYSICS_PLUGIN
Entity CreateDynamicCube(const float& mass, const glm::vec3& color, const glm::vec3& position,
Expand Down Expand Up @@ -61,7 +66,12 @@ int main() {
Application::PushLayer<WindowLayer>();
Application::PushLayer<EditorLayer>();
Application::PushLayer<RenderLayer>();
#ifdef UNIVERSE_PLUGIN
SystemRegistration<StarClusterSystem>("StarClusterSystem");
SystemRegistration<PlanetTerrainSystem>("PlanetTerrainSystem");
PrivateComponentRegistration<PlanetTerrain>("PlanetTerrain");

#endif
#ifdef OPTIX_RAY_TRACER_PLUGIN
Application::PushLayer<RayTracerLayer>();
#endif
Expand Down Expand Up @@ -320,9 +330,10 @@ void SetupDemoScene(DemoSetup demo_setup, ApplicationInfo& application_info) {
});
} break;
case DemoSetup::Galaxy: {
application_info.application_name = "Galaxy Demo";
SystemRegistration<StarClusterSystem>("StarClusterSystem");
application_info.project_path = resource_folder_path / "Example Projects/Galaxy/Galaxy.eveproj";
application_info.application_name = "Universe Demo";

application_info.project_path = resource_folder_path / "Example Projects/Universe/Universe.eveproj";
#ifdef UNIVERSE_PLUGIN
ProjectManager::SetActionAfterNewScene([&](const std::shared_ptr<Scene>& scene) {
const auto main_camera = scene->main_camera.Get<Camera>();
main_camera->Resize({640, 480});
Expand All @@ -333,13 +344,12 @@ void SetupDemoScene(DemoSetup demo_setup, ApplicationInfo& application_info) {
#pragma endregion
main_camera->use_clear_color = true;
});
#endif
} break;
case DemoSetup::Planets: {
application_info.application_name = "Planets Demo";
SystemRegistration<PlanetTerrainSystem>("PlanetTerrainSystem");
PrivateComponentRegistration<PlanetTerrain>("PlanetTerrain");

application_info.project_path = resource_folder_path / "Example Projects/Planet/Planet.eveproj";
#ifdef UNIVERSE_PLUGIN
ProjectManager::SetActionAfterNewScene([&](const std::shared_ptr<Scene>& scene) {
#pragma region Preparations
const auto main_camera = scene->main_camera.Get<Camera>();
Expand All @@ -356,7 +366,7 @@ void SetupDemoScene(DemoSetup demo_setup, ApplicationInfo& application_info) {
std::dynamic_pointer_cast<Texture2D>(ProjectManager::GetOrCreateAsset("Textures/border.png"));
surface_material->SetAlbedoTexture(border_texture);

auto pts = scene->GetOrCreateSystem<planet::PlanetTerrainSystem>(SystemGroup::SimulationSystemGroup);
auto pts = scene->GetOrCreateSystem<Universe::PlanetTerrainSystem>(SystemGroup::SimulationSystemGroup);

pts->Enable();

Expand Down Expand Up @@ -455,6 +465,7 @@ void SetupDemoScene(DemoSetup demo_setup, ApplicationInfo& application_info) {
glm::vec3(20.0f * glm::cos(Times::Now() / 2.0f), 15.0f, 20.0f * glm::sin(Times::Now() / 2.0f)), 0.0f));
scene->SetDataComponent(ple2, ltw);
#pragma endregion
#endif
});
});
} break;
Expand Down
34 changes: 34 additions & 0 deletions EvoEngine_App/DigitalAgriculture/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
if (${CMAKE_BINARY_DIR} STREQUAL ${PROJECT_BINARY_DIR} AND EVOENGINE_PLUGIN_DIGITAL_AGRICULTURE)
option(ECOSYSLAB_APPLICATION "Build DigitalAgriculture application" ON)
if(ECOSYSLAB_APPLICATION)
set(DEFAULT_PROJECT_DIR ${CMAKE_CURRENT_SOURCE_DIR}/Resources/DigitalAgricultureProject/)
set(DEFAULT_PROJECT_DEF ECOSYSLAB_DEFAULT_PROJECT_FOLDER=\"${DEFAULT_PROJECT_DIR}\")

add_executable(DigitalAgricultureApp
DigitalAgricultureApp.cpp)

target_compile_definitions(DigitalAgricultureApp
PRIVATE
${DEFAULT_PROJECT_DEF}
${EVOENGINE_DEFS}
)
target_include_directories(DigitalAgricultureApp
PRIVATE
${EVOENGINE_INCLUDES}
)

target_precompile_headers(DigitalAgricultureApp
PRIVATE
${EVOENGINE_PCHS}
)

target_link_libraries(DigitalAgricultureApp
PRIVATE
EvoEngine_SDK
${EvoEngine_Plugins}
)

file(COPY imgui.ini DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
evoengine_copy_resources(DigitalAgricultureApp ${CMAKE_CURRENT_BINARY_DIR})
endif ()
endif ()
Loading

0 comments on commit ca92afe

Please sign in to comment.