Steering speed tuning

This commit is contained in:
tovjemam 2026-06-22 20:03:30 +02:00
parent 998766b004
commit cbc46c9ff5
4 changed files with 6 additions and 1 deletions

View File

@ -189,7 +189,7 @@ void game::Vehicle::ProcessInput()
float steeringClamp = std::max(minsc, (1.f - (std::abs(speed) / sl)) * maxsc);
// steeringClamp = .5f;
float steeringSpeed = steeringClamp * 5.0f;
float steeringSpeed = steeringClamp * steering_speed_;
if (steering_analog_)
steeringSpeed *= 3.0f;
@ -641,6 +641,7 @@ void game::Vehicle::ApplyTuning(const VehicleTuning& tuning)
}
health_ = tuning_ctx_.health;
steering_speed_ = tuning_ctx_.steering;
// (re)create physics
physics_.reset();

View File

@ -136,6 +136,7 @@ private:
float steering_ = 0.0f;
bool steering_analog_ = false;
float target_steering_ = 0.0f;
float steering_speed_ = 5.0f;
std::vector<VehicleWheelState> wheels_;

View File

@ -14,6 +14,8 @@ static float game::VehicleTuningContext::* GetCtxVariablePointer(const std::stri
return &game::VehicleTuningContext::braking_force;
if (name == "health")
return &game::VehicleTuningContext::health;
if (name == "steering")
return &game::VehicleTuningContext::steering;
throw std::runtime_error("tuning list: invalid variable " + name);
}

View File

@ -35,6 +35,7 @@ struct VehicleTuningContext
float engine_force;
float braking_force;
float health;
float steering;
std::vector<VehicleWheelTuningContext> wheels;
};