feat(Handling): Added nearly all handling modifications

This commit is contained in:
Yimura 2021-08-04 21:33:37 +02:00
parent da5ae55dd6
commit 9b8c441a11
11 changed files with 129 additions and 62 deletions

View File

@ -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();
}

View File

@ -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();
}
}
};

View File

@ -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);

View File

@ -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();
}
}
};

View File

@ -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();
}
}
};

View File

@ -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();
}
}
};

View File

@ -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();
}
}

View File

@ -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();

View File

@ -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;

View File

@ -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);

View File

@ -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();