From 9b8c441a11b1f0c2456f8495c7dc4d76573c57d6 Mon Sep 17 00:00:00 2001 From: Yimura Date: Wed, 4 Aug 2021 21:33:37 +0200 Subject: [PATCH] feat(Handling): Added nearly all handling modifications --- ...ndling_braking.cpp => handling_brakes.cpp} | 8 ++--- .../gui/window/handling/handling_gearing.cpp | 23 ++++++++++++++ ...dling_physics.cpp => handling_general.cpp} | 16 ++-------- .../gui/window/handling/handling_other.cpp | 30 +++++++++++++++++++ .../handling/handling_roll_centre_height.cpp | 22 ++++++++++++++ .../gui/window/handling/handling_rollbars.cpp | 20 +++++++++++++ .../window/handling/handling_suspension.cpp | 28 +++++------------ .../src/gui/window/handling/handling_tabs.hpp | 8 +++-- .../gui/window/handling/handling_traction.cpp | 13 ++++---- .../window/handling/handling_transmission.cpp | 11 ------- BigBaseV2/src/gui/window/window_handling.cpp | 12 ++++---- 11 files changed, 129 insertions(+), 62 deletions(-) rename BigBaseV2/src/gui/window/handling/{handling_braking.cpp => handling_brakes.cpp} (59%) create mode 100644 BigBaseV2/src/gui/window/handling/handling_gearing.cpp rename BigBaseV2/src/gui/window/handling/{handling_physics.cpp => handling_general.cpp} (59%) create mode 100644 BigBaseV2/src/gui/window/handling/handling_other.cpp create mode 100644 BigBaseV2/src/gui/window/handling/handling_roll_centre_height.cpp create mode 100644 BigBaseV2/src/gui/window/handling/handling_rollbars.cpp diff --git a/BigBaseV2/src/gui/window/handling/handling_braking.cpp b/BigBaseV2/src/gui/window/handling/handling_brakes.cpp similarity index 59% rename from BigBaseV2/src/gui/window/handling/handling_braking.cpp rename to BigBaseV2/src/gui/window/handling/handling_brakes.cpp index 6aa4de30..dabab7fc 100644 --- a/BigBaseV2/src/gui/window/handling/handling_braking.cpp +++ b/BigBaseV2/src/gui/window/handling/handling_brakes.cpp @@ -2,12 +2,12 @@ namespace big { - void tab_handling::tab_braking() + void tab_handling::tab_brakes() { - if (ImGui::BeginTabItem("Braking")) + if (ImGui::BeginTabItem("Brakes")) { ImGui::Text("Brake Force"); - ImGui::SliderFloat("##brake force", &g_local_player->m_vehicle->m_handling->m_brake_force, -50.f, 50.f); + ImGui::DragFloat("##brake force", &g_local_player->m_vehicle->m_handling->m_brake_force, .01f, 0.f, 10.f); ImGui::Text("Brake Bias (1.0 = front, 0.0 = rear, 0.5 = balanced)"); float fBrakeBias = g_local_player->m_vehicle->m_handling->m_brake_bias_front / 2; @@ -15,7 +15,7 @@ namespace big g_local_player->m_vehicle->m_handling->m_brake_bias_front = fBrakeBias * 2; ImGui::Text("Hand Brake Force"); - ImGui::SliderFloat("##hand brake force", &g_local_player->m_vehicle->m_handling->m_handbrake_force, -50.f, 50.f); + ImGui::DragFloat("##hand brake force", &g_local_player->m_vehicle->m_handling->m_handbrake_force, .01f, 0.f, 10.f); ImGui::EndTabItem(); } diff --git a/BigBaseV2/src/gui/window/handling/handling_gearing.cpp b/BigBaseV2/src/gui/window/handling/handling_gearing.cpp new file mode 100644 index 00000000..666885e3 --- /dev/null +++ b/BigBaseV2/src/gui/window/handling/handling_gearing.cpp @@ -0,0 +1,23 @@ +#include "handling_tabs.hpp" + +namespace big +{ + void tab_handling::tab_gearing() + { + if (ImGui::BeginTabItem("Gearing")) + { + ImGui::Text("Initial Drive Gears"); + int initial_drive_gears = g_local_player->m_vehicle->m_handling->m_initial_drive_gears; + if (ImGui::DragInt("###handling_drive_gears", &initial_drive_gears, .1f, 1, 16)) + g_local_player->m_vehicle->m_handling->m_initial_drive_gears = initial_drive_gears; + + ImGui::Text("Upshift Multiplier"); + ImGui::DragFloat("###handling_upshift", &g_local_player->m_vehicle->m_handling->m_upshift, .01f, 0.f, 10.f); + + ImGui::Text("Downshift Multiplier"); + ImGui::DragFloat("###handling_downshift", &g_local_player->m_vehicle->m_handling->m_downshift, .01f, 0.f, 10.f); + + ImGui::EndTabItem(); + } + } +}; \ No newline at end of file diff --git a/BigBaseV2/src/gui/window/handling/handling_physics.cpp b/BigBaseV2/src/gui/window/handling/handling_general.cpp similarity index 59% rename from BigBaseV2/src/gui/window/handling/handling_physics.cpp rename to BigBaseV2/src/gui/window/handling/handling_general.cpp index 57fb6982..cbcdcc5a 100644 --- a/BigBaseV2/src/gui/window/handling/handling_physics.cpp +++ b/BigBaseV2/src/gui/window/handling/handling_general.cpp @@ -2,9 +2,9 @@ namespace big { - void tab_handling::tab_phyics() + void tab_handling::tab_general() { - if (ImGui::BeginTabItem("Physics")) + if (ImGui::BeginTabItem("General")) { ImGui::Text("Gravity"); ImGui::SliderFloat("##Gravity", &g_local_player->m_vehicle->m_gravity, -50.f, 50.f); @@ -24,18 +24,6 @@ namespace big g_local_player->m_vehicle->m_handling->m_centre_of_mass.z = fCenterOfMass[2]; } - ImGui::Text("Inertia Multiplier"); - float fInertiaMult[3]; - fInertiaMult[0] = g_local_player->m_vehicle->m_handling->m_inertia_mult.x; - fInertiaMult[1] = g_local_player->m_vehicle->m_handling->m_inertia_mult.y; - fInertiaMult[2] = g_local_player->m_vehicle->m_handling->m_inertia_mult.z; - if (ImGui::SliderFloat3("##inertia_multiplier", fInertiaMult, -10.f, 10.f)) - { - g_local_player->m_vehicle->m_handling->m_inertia_mult.x = fInertiaMult[0]; - g_local_player->m_vehicle->m_handling->m_inertia_mult.y = fInertiaMult[1]; - g_local_player->m_vehicle->m_handling->m_inertia_mult.z = fInertiaMult[2]; - } - ImGui::Text("Buoyancy"); ImGui::SliderFloat("##buoyancy", &g_local_player->m_vehicle->m_handling->m_buoyancy, .01f, 99.f); diff --git a/BigBaseV2/src/gui/window/handling/handling_other.cpp b/BigBaseV2/src/gui/window/handling/handling_other.cpp new file mode 100644 index 00000000..434da6bc --- /dev/null +++ b/BigBaseV2/src/gui/window/handling/handling_other.cpp @@ -0,0 +1,30 @@ +#include "handling_tabs.hpp" + +namespace big +{ + void tab_handling::tab_other() + { + if (ImGui::BeginTabItem("Other")) + { + ImGui::Text("Acceleration Multiplier"); + ImGui::DragFloat("###handling_acceleration", &g_local_player->m_vehicle->m_handling->m_acceleration, 1.f, .01f, 10.f); + + ImGui::Text("Downforce Multiplier"); + ImGui::DragFloat("###handling_downforce", &g_local_player->m_vehicle->m_handling->m_downforce_multiplier, 1.f, 0.f, 10.f); + + ImGui::Text("Inertia Multiplier"); + float fInertiaMult[3]; + fInertiaMult[0] = g_local_player->m_vehicle->m_handling->m_inertia_mult.x; + fInertiaMult[1] = g_local_player->m_vehicle->m_handling->m_inertia_mult.y; + fInertiaMult[2] = g_local_player->m_vehicle->m_handling->m_inertia_mult.z; + if (ImGui::SliderFloat3("##inertia_multiplier", fInertiaMult, -10.f, 10.f)) + { + g_local_player->m_vehicle->m_handling->m_inertia_mult.x = fInertiaMult[0]; + g_local_player->m_vehicle->m_handling->m_inertia_mult.y = fInertiaMult[1]; + g_local_player->m_vehicle->m_handling->m_inertia_mult.z = fInertiaMult[2]; + } + + ImGui::EndTabItem(); + } + } +}; \ No newline at end of file diff --git a/BigBaseV2/src/gui/window/handling/handling_roll_centre_height.cpp b/BigBaseV2/src/gui/window/handling/handling_roll_centre_height.cpp new file mode 100644 index 00000000..84b6ef5b --- /dev/null +++ b/BigBaseV2/src/gui/window/handling/handling_roll_centre_height.cpp @@ -0,0 +1,22 @@ +#include "handling_tabs.hpp" + +namespace big +{ + void tab_handling::tab_roll_centre_height() + { + if (ImGui::BeginTabItem("Roll Centre Height")) + { + ImGui::Text("The point in the transverse vertical plane through any pair of wheel centres\nat which lateral forces apply to the sprung mass without producing suspension roll."); + + ImGui::Separator(); + + ImGui::Text("Roll Centre Height Front"); + ImGui::SliderFloat("##roll centre height front", &g_local_player->m_vehicle->m_handling->m_roll_centre_height_front, -1.f, 1.f); + + ImGui::Text("Roll Centre Height Back"); + ImGui::SliderFloat("##roll centre height back", &g_local_player->m_vehicle->m_handling->m_roll_centre_height_rear, -1.f, 1.f); + + ImGui::EndTabItem(); + } + } +}; \ No newline at end of file diff --git a/BigBaseV2/src/gui/window/handling/handling_rollbars.cpp b/BigBaseV2/src/gui/window/handling/handling_rollbars.cpp new file mode 100644 index 00000000..065be22b --- /dev/null +++ b/BigBaseV2/src/gui/window/handling/handling_rollbars.cpp @@ -0,0 +1,20 @@ +#include "handling_tabs.hpp" + +namespace big +{ + void tab_handling::tab_rollbars() + { + if (ImGui::BeginTabItem("Rollbars")) + { + ImGui::Text("Anti-Roll Bar force"); + ImGui::SliderFloat("##anti rollbar force", &g_local_player->m_vehicle->m_handling->m_anti_rollbar_force, 0.f, 10.f); + + ImGui::Text("Anti-Roll Bar Bias front (0 = front, 1 = rear)"); + float fAntiRollBarBiasFront = g_local_player->m_vehicle->m_handling->m_anti_rollbar_bias_front / 2; + if (ImGui::SliderFloat("##anti rollbar bias", &fAntiRollBarBiasFront, 0.f, 1.f)) + g_local_player->m_vehicle->m_handling->m_anti_rollbar_bias_front = fAntiRollBarBiasFront * 2; + + ImGui::EndTabItem(); + } + } +}; \ No newline at end of file diff --git a/BigBaseV2/src/gui/window/handling/handling_suspension.cpp b/BigBaseV2/src/gui/window/handling/handling_suspension.cpp index 94b3bc6f..5d2d1cb9 100644 --- a/BigBaseV2/src/gui/window/handling/handling_suspension.cpp +++ b/BigBaseV2/src/gui/window/handling/handling_suspension.cpp @@ -6,43 +6,29 @@ namespace big { if (ImGui::BeginTabItem("Suspension")) { - ImGui::Text("Suspension Strength"); + ImGui::Text("Suspension Force (General Suspension Strength)"); ImGui::SliderFloat("##suspension force", &g_local_player->m_vehicle->m_handling->m_suspension_force, 0.f, 5.f); - ImGui::Text("Suspension Compression (higher = stiffer)"); + ImGui::Text("Suspension Compression Damp (Higher = Less Compression)"); ImGui::SliderFloat("##suspension comp", &g_local_player->m_vehicle->m_handling->m_suspension_comp_damp, 0.f, 5.f); - ImGui::Text("Suspension Rebound (higher = stiffer)"); + ImGui::Text("Suspension Rebound Damp (Higher = Less Decompression)"); ImGui::SliderFloat("##suspension rebound", &g_local_player->m_vehicle->m_handling->m_suspension_rebound_damp, 0.f, 5.f); - ImGui::Text("Suspension Upper Limit"); + ImGui::Text("Suspension Upper Limit (mostly visual)"); ImGui::SliderFloat("##suspension upper", &g_local_player->m_vehicle->m_handling->m_suspension_upper_limit, -1.f, 1.f); - ImGui::Text("Suspension Lower Limit"); + ImGui::Text("Suspension Lower Limit (mostly visual)"); ImGui::SliderFloat("##suspension lower", &g_local_player->m_vehicle->m_handling->m_suspension_lower_limit, -1.f, 1.f); - ImGui::Text("Suspension Raise"); + ImGui::Text("Suspension Raise (Ride Height)"); ImGui::SliderFloat("##suspension raise", &g_local_player->m_vehicle->m_handling->m_suspension_raise, -1.f, 1.f); - ImGui::Text("Suspension Bias (0.0 = front stiffer, 1.0 = rear stiffer"); + ImGui::Text("Suspension Bias Front (Strength Bias, 1 = front, 0 = rear)"); float fSuspensionBiasFront = g_local_player->m_vehicle->m_handling->m_suspension_bias_front / 2; if (ImGui::SliderFloat("##suspension bias", &fSuspensionBiasFront, 0.f, 1.f)) g_local_player->m_vehicle->m_handling->m_suspension_bias_front = fSuspensionBiasFront * 2; - ImGui::Text("Anti Rollbar Force (large = less body roll)"); - ImGui::SliderFloat("##anti rollbar force", &g_local_player->m_vehicle->m_handling->m_anti_rollbar_force, 0.f, 10.f); - - ImGui::Text("Anti Rollbar Bias (0 = front, 1 = rear)"); - float fAntiRollBarBiasFront = g_local_player->m_vehicle->m_handling->m_anti_rollbar_bias_front / 2; - if (ImGui::SliderFloat("##anti rollbar bias", &fAntiRollBarBiasFront, 0.f, 1.f)) - g_local_player->m_vehicle->m_handling->m_anti_rollbar_bias_front = fAntiRollBarBiasFront * 2; - - ImGui::Text("Roll Centre Height Front"); - ImGui::SliderFloat("##roll centre height front", &g_local_player->m_vehicle->m_handling->m_roll_centre_height_front, -1.f, 1.f); - - ImGui::Text("Roll Centre Height Back"); - ImGui::SliderFloat("##roll centre height back", &g_local_player->m_vehicle->m_handling->m_roll_centre_height_rear, -1.f, 1.f); - ImGui::EndTabItem(); } } diff --git a/BigBaseV2/src/gui/window/handling/handling_tabs.hpp b/BigBaseV2/src/gui/window/handling/handling_tabs.hpp index a9f614f2..46be770c 100644 --- a/BigBaseV2/src/gui/window/handling/handling_tabs.hpp +++ b/BigBaseV2/src/gui/window/handling/handling_tabs.hpp @@ -7,8 +7,12 @@ namespace big class tab_handling { public: - static void tab_braking(); - static void tab_phyics(); + static void tab_brakes(); + static void tab_gearing(); + static void tab_general(); + static void tab_other(); + static void tab_rollbars(); + static void tab_roll_centre_height(); static void tab_suspension(); static void tab_steering(); static void tab_traction(); diff --git a/BigBaseV2/src/gui/window/handling/handling_traction.cpp b/BigBaseV2/src/gui/window/handling/handling_traction.cpp index 418b145f..6d4f44f4 100644 --- a/BigBaseV2/src/gui/window/handling/handling_traction.cpp +++ b/BigBaseV2/src/gui/window/handling/handling_traction.cpp @@ -6,20 +6,23 @@ namespace big { if (ImGui::BeginTabItem("Traction")) { - ImGui::Text("Acceleration/Braking Grip"); + ImGui::Text("Minimum Traction"); ImGui::SliderFloat("##traction curve min", &g_local_player->m_vehicle->m_handling->m_traction_curve_min, 0.f, 7.f); - ImGui::Text("Cornering Grip"); + ImGui::Text("Peak Traction before grip is lost"); ImGui::SliderFloat("##traction curve max", &g_local_player->m_vehicle->m_handling->m_traction_curve_max, 0.f, 7.f); - ImGui::Text("Traction Spring Delta Max (distance from ground => grip)"); + ImGui::Text("Traction Curve (point of grip loss)"); + ImGui::SliderAngle("##traction curve lateral", &g_local_player->m_vehicle->m_handling->m_traction_curve_lateral); + + ImGui::Text("Traction Height Loss (distance ground and tires)"); ImGui::SliderFloat("##traction spring delta max", &g_local_player->m_vehicle->m_handling->m_traction_spring_delta_max, 0.f, 2.f); ImGui::Text("Burnout Multiplier"); ImGui::SliderFloat("##low speed traction loss mult", &g_local_player->m_vehicle->m_handling->m_low_speed_traction_loss_mult, 0.f, 10.f); - ImGui::Text("Camber Stiffness (grip when drifting)"); - ImGui::SliderFloat("##camber stiffness", &g_local_player->m_vehicle->m_handling->m_camber_stiffness, -1.f, 1.f); + //ImGui::Text("Camber Stiffness (grip when drifting)"); + //ImGui::SliderFloat("##camber stiffness", &g_local_player->m_vehicle->m_handling->m_camber_stiffness, -1.f, 1.f); ImGui::Text("Traction Bias (1.0 = front, 0.0 = rear, 0.5 = balanced)"); float fTractionBiasFront = g_local_player->m_vehicle->m_handling->m_traction_bias_front / 2; diff --git a/BigBaseV2/src/gui/window/handling/handling_transmission.cpp b/BigBaseV2/src/gui/window/handling/handling_transmission.cpp index 761aea6c..9a82da8e 100644 --- a/BigBaseV2/src/gui/window/handling/handling_transmission.cpp +++ b/BigBaseV2/src/gui/window/handling/handling_transmission.cpp @@ -16,17 +16,6 @@ namespace big if (ImGui::SliderFloat("##drive_bias_rear", &fDriveBiasRear, 0.f, 1.0f)) g_local_player->m_vehicle->m_handling->m_drive_bias_rear = fDriveBiasRear * 2; - ImGui::Text("Gears"); - int nInitialDriveGears = g_local_player->m_vehicle->m_handling->m_initial_drive_gears; - if (ImGui::SliderInt("##initial_gears", &nInitialDriveGears, 1, 12)) - g_local_player->m_vehicle->m_handling->m_initial_drive_gears = nInitialDriveGears; - - ImGui::Text("Upshift Rate"); - ImGui::SliderFloat("##upshift", &g_local_player->m_vehicle->m_handling->m_upshift, 0.f, 10.f); - - ImGui::Text("Downshift Rate"); - ImGui::SliderFloat("##downshift", &g_local_player->m_vehicle->m_handling->m_downshift, 0.f, 10.f); - ImGui::Text("Transmission Output (force)"); ImGui::SliderFloat("##initial drive force", &g_local_player->m_vehicle->m_handling->m_initial_drive_force, 0.01f, 2.f); diff --git a/BigBaseV2/src/gui/window/window_handling.cpp b/BigBaseV2/src/gui/window/window_handling.cpp index d748ab37..472d3e20 100644 --- a/BigBaseV2/src/gui/window/window_handling.cpp +++ b/BigBaseV2/src/gui/window/window_handling.cpp @@ -18,13 +18,15 @@ namespace big } ImGui::BeginTabBar("handling_tabbar"); - tab_handling::tab_phyics(); - tab_handling::tab_braking(); - tab_handling::tab_steering(); + tab_handling::tab_general(); + tab_handling::tab_other(); + tab_handling::tab_brakes(); + tab_handling::tab_gearing(); tab_handling::tab_traction(); + tab_handling::tab_steering(); tab_handling::tab_suspension(); - // rollbars - // misc + tab_handling::tab_rollbars(); + tab_handling::tab_roll_centre_height(); ImGui::EndTabBar(); ImGui::End();