diff --git a/enginecustom/imgui.ini b/enginecustom/imgui.ini index 2c23bb3..0f1daac 100644 --- a/enginecustom/imgui.ini +++ b/enginecustom/imgui.ini @@ -16,7 +16,7 @@ DockId=0x00000006,0 [Window][render Stats] Pos=0,630 -Size=1584,231 +Size=1350,231 Collapsed=0 DockId=0x00000009,0 @@ -27,7 +27,7 @@ Collapsed=0 DockId=0x0000000B,0 [Window][Terrain] -Pos=0,19 +Pos=236,19 Size=266,842 Collapsed=0 DockId=0x00000007,0 @@ -45,23 +45,29 @@ Collapsed=0 DockId=0x0000000B,0 [Window][Engine Settings] -Pos=1267,462 -Size=317,166 +Pos=1267,19 +Size=317,842 +Collapsed=0 +DockId=0x00000006,0 + +[Window][Inspector] +Pos=1352,19 +Size=232,842 Collapsed=0 DockId=0x00000002,0 [Docking][Data] DockSpace ID=0xCCBD8CF7 Window=0x3DA2F1DE Pos=0,19 Size=1584,842 Split=X - DockNode ID=0x00000005 Parent=0xCCBD8CF7 SizeRef=1265,842 Split=Y - DockNode ID=0x00000003 Parent=0x00000005 SizeRef=1584,609 Split=X - DockNode ID=0x0000000B Parent=0x00000003 SizeRef=234,842 Selected=0x031DC75C - DockNode ID=0x0000000C Parent=0x00000003 SizeRef=1348,842 Split=X - DockNode ID=0x00000007 Parent=0x0000000C SizeRef=266,842 Selected=0x393905AB - DockNode ID=0x00000008 Parent=0x0000000C SizeRef=1316,842 Split=X - DockNode ID=0x00000001 Parent=0x00000008 SizeRef=1265,842 CentralNode=1 - DockNode ID=0x00000002 Parent=0x00000008 SizeRef=317,842 Selected=0x9F035453 - DockNode ID=0x00000004 Parent=0x00000005 SizeRef=1584,231 Split=X Selected=0xF5D1BB37 - DockNode ID=0x00000009 Parent=0x00000004 SizeRef=792,231 Selected=0xF5D1BB37 - DockNode ID=0x0000000A Parent=0x00000004 SizeRef=790,231 Selected=0xAB74BEE9 - DockNode ID=0x00000006 Parent=0xCCBD8CF7 SizeRef=317,842 Selected=0x9F035453 + DockNode ID=0x00000001 Parent=0xCCBD8CF7 SizeRef=1350,842 Split=X + DockNode ID=0x00000005 Parent=0x00000001 SizeRef=1265,842 Split=Y + DockNode ID=0x00000003 Parent=0x00000005 SizeRef=1584,609 Split=X + DockNode ID=0x0000000B Parent=0x00000003 SizeRef=234,842 Selected=0x031DC75C + DockNode ID=0x0000000C Parent=0x00000003 SizeRef=1348,842 Split=X + DockNode ID=0x00000007 Parent=0x0000000C SizeRef=266,842 Selected=0x393905AB + DockNode ID=0x00000008 Parent=0x0000000C SizeRef=1316,842 CentralNode=1 + DockNode ID=0x00000004 Parent=0x00000005 SizeRef=1584,231 Split=X Selected=0xF5D1BB37 + DockNode ID=0x00000009 Parent=0x00000004 SizeRef=792,231 Selected=0xF5D1BB37 + DockNode ID=0x0000000A Parent=0x00000004 SizeRef=790,231 Selected=0xAB74BEE9 + DockNode ID=0x00000006 Parent=0x00000001 SizeRef=317,842 Selected=0x0B098C4B + DockNode ID=0x00000002 Parent=0xCCBD8CF7 SizeRef=232,842 Selected=0x36DC96AB diff --git a/enginecustom/src/inc/system/application_class.h b/enginecustom/src/inc/system/application_class.h index 17096c2..bed2ce6 100644 --- a/enginecustom/src/inc/system/application_class.h +++ b/enginecustom/src/inc/system/application_class.h @@ -451,7 +451,22 @@ public: */ std::map>& get_model_cache() { return g_model_cache; } + /** + * Get the sky entity ID. + * @return The sky entity ID as an integer. + */ int get_sky_id() const { return sky_id_; } + + /** + * Set the sky entity size. + * @return The sky entity size as a float. + */ + XMVECTOR get_sky_distance() const { return sky_distance_; }; + /** + * Set the sky entity size. + * @param distance The new sky entity size as a float. + */ + void set_sky_distance(XMVECTOR distance); private: /** @@ -594,9 +609,10 @@ private : float speed_ = 0.1f; // speed for the demo spinning object std::vector imported_object_; int object_id_ = 0; - //std::vector skybox_; + int sky_id_ = -1; std::shared_ptr sky_entity_; + XMVECTOR sky_distance_ = XMVectorSet(2.0f, 2.0f, 2.0f, 0.0f); // ----------------------------------- // // ------------- LIGHTS -------------- // diff --git a/enginecustom/src/src/system/application_class.cpp b/enginecustom/src/src/system/application_class.cpp index 92e4592..9345dad 100644 --- a/enginecustom/src/src/system/application_class.cpp +++ b/enginecustom/src/src/system/application_class.cpp @@ -2110,7 +2110,7 @@ bool application_class::create_skysphere() auto transform = sky_entity_->AddComponent(); transform->SetPosition(XMVectorSet(0.0f, 0.0f, 0.0f, 0.0f)); - transform->SetScale(XMVectorSet(2.0f, 2.0f, 2.0f, 0.0f)); + transform->SetScale(sky_distance_); transform->UpdateWorldMatrix(); auto render = sky_entity_->AddComponent(); diff --git a/enginecustom/src/src/system/imguiManager.cpp b/enginecustom/src/src/system/imguiManager.cpp index d6d5765..d201791 100644 --- a/enginecustom/src/src/system/imguiManager.cpp +++ b/enginecustom/src/src/system/imguiManager.cpp @@ -762,16 +762,6 @@ bool imguiManager::ImGuiWidgetRenderer() SetupDockspace(); //ImGui Widget - ImGui::Begin("Khaotic Engine", NULL); - - float speed = app_->get_speed(); - - WidgetSpeedSlider(&speed); - app_->set_speed(speed); - WidgetButton(); - WidgetAddObject(); - - ImGui::End(); // Read the widget list and call the function if the show variable is true for (const auto& entry : widgets_) @@ -854,47 +844,72 @@ void imguiManager::WidgetEngineSettingsWindow() { ImGui::Begin("Engine Settings", &showEngineSettingsWindow); - // Begining Of General Setting - ImGui::Text("General"); - - // Checkbox for toggling vsync globally in the application class by calling the set_vsync function in the application class when the checkbox state changes - bool vsync = app_->get_vsync(); - if (ImGui::Checkbox("Vsync", &vsync)) + if (ImGui::BeginTabBar("Engine Settings")) { - app_->set_vsync(vsync); - } + if (ImGui::BeginTabItem("General")) + { + bool v_sync = app_->get_vsync(); + if (ImGui::Checkbox("Vsync", &v_sync)) + { + app_->set_vsync(v_sync); + } + if (ImGui::IsItemHovered()) + { + ImGui::SetTooltip("Enable or disable Vsync"); + } + + ImGui::EndTabItem(); + } + + if (ImGui::BeginTabItem("Culling Settings")) + { + float frustumTolerance = app_->get_frustum_tolerance(); + if (ImGui::DragFloat("Frustum Tolerance", &frustumTolerance, 0.1f, 0.0f, 100.0f)) + { + app_->set_frustum_tolerance(frustumTolerance); + } + if (ImGui::IsItemHovered()) + { + ImGui::SetTooltip("Set the frustum tolerance for culling"); + } + ImGui::EndTabItem(); + } - // End Of General Setting - ImGui::Separator(); - // culling section - ImGui::Text("Culling"); + if (ImGui::BeginTabItem("Physics Settings")) + { + int physics_tick_rate = app_->get_physics_tick_rate(); + XMVECTOR gravity = app_->get_physics()->GetGravity(); + float gravity_values[3] = { XMVectorGetX(gravity), XMVectorGetY(gravity), XMVectorGetZ(gravity) }; + + if (ImGui::InputInt("Physics Tick Rate", &physics_tick_rate)) + { + app_->set_physics_tick_rate(physics_tick_rate); + } + if (ImGui::IsItemHovered()) + { + ImGui::SetTooltip("Set the physics tick rate (Fixed Update Interval)"); + } - // float input for frustum tolerance - float frustumTolerance = app_->get_frustum_tolerance(); - if (ImGui::DragFloat("Frustum Tolerance", &frustumTolerance, 0.1f, 0.0f, 100.0f)) - { - app_->set_frustum_tolerance(frustumTolerance); - } + if (ImGui::DragFloat3("Gravity", gravity_values)) + { + app_->get_physics()->SetGravity(XMVectorSet(gravity_values[0], gravity_values[1], gravity_values[2], 0.0f)); + } + if (ImGui::IsItemHovered()) + { + ImGui::SetTooltip("Set the gravity vector for the physics engine"); + } + + ImGui::EndTabItem(); + } - // End Of Culling Setting - ImGui::Separator(); + if (ImGui::BeginTabItem("Skysphere Settings")) + { - // physics section - ImGui::Text("physics"); - - // Input To set the Fixed Update Interval - int physicsInterval = app_->get_physics_tick_rate(); - if (ImGui::InputInt("physics Tick Rate", &physicsInterval)) - { - app_->set_physics_tick_rate(physicsInterval); - } - - // Input to change the gravity on same line - XMVECTOR gravity = app_->get_physics()->GetGravity(); - float gravityValues[3] = { XMVectorGetX(gravity), XMVectorGetY(gravity), XMVectorGetZ(gravity) }; - if (ImGui::DragFloat3("Gravity", gravityValues)) - { - app_->get_physics()->SetGravity(XMVectorSet(gravityValues[0], gravityValues[1], gravityValues[2], 0.0f)); + //float skysphere_size = app_->get_sky()-> + + } + + ImGui::EndTabBar(); } ImGui::End(); diff --git a/x64/Debug/config.txt b/x64/Debug/config.txt index 7451438..2d5d9b4 100644 --- a/x64/Debug/config.txt +++ b/x64/Debug/config.txt @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:650c8d5dcda7df59eaa6db23e5e1c5f391d64360781facb9b3b297baaed5b921 +oid sha256:87ab8fabde4621ecb618fa265ef5e7a87cae4f71dcee5bd74fae2272f955cd12 size 8 diff --git a/x64/Release/config.txt b/x64/Release/config.txt index 7451438..2d5d9b4 100644 --- a/x64/Release/config.txt +++ b/x64/Release/config.txt @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:650c8d5dcda7df59eaa6db23e5e1c5f391d64360781facb9b3b297baaed5b921 +oid sha256:87ab8fabde4621ecb618fa265ef5e7a87cae4f71dcee5bd74fae2272f955cd12 size 8