Steering speed tuning
This commit is contained in:
parent
998766b004
commit
cbc46c9ff5
@ -189,7 +189,7 @@ void game::Vehicle::ProcessInput()
|
|||||||
|
|
||||||
float steeringClamp = std::max(minsc, (1.f - (std::abs(speed) / sl)) * maxsc);
|
float steeringClamp = std::max(minsc, (1.f - (std::abs(speed) / sl)) * maxsc);
|
||||||
// steeringClamp = .5f;
|
// steeringClamp = .5f;
|
||||||
float steeringSpeed = steeringClamp * 5.0f;
|
float steeringSpeed = steeringClamp * steering_speed_;
|
||||||
if (steering_analog_)
|
if (steering_analog_)
|
||||||
steeringSpeed *= 3.0f;
|
steeringSpeed *= 3.0f;
|
||||||
|
|
||||||
@ -641,6 +641,7 @@ void game::Vehicle::ApplyTuning(const VehicleTuning& tuning)
|
|||||||
}
|
}
|
||||||
|
|
||||||
health_ = tuning_ctx_.health;
|
health_ = tuning_ctx_.health;
|
||||||
|
steering_speed_ = tuning_ctx_.steering;
|
||||||
|
|
||||||
// (re)create physics
|
// (re)create physics
|
||||||
physics_.reset();
|
physics_.reset();
|
||||||
|
|||||||
@ -136,6 +136,7 @@ private:
|
|||||||
float steering_ = 0.0f;
|
float steering_ = 0.0f;
|
||||||
bool steering_analog_ = false;
|
bool steering_analog_ = false;
|
||||||
float target_steering_ = 0.0f;
|
float target_steering_ = 0.0f;
|
||||||
|
float steering_speed_ = 5.0f;
|
||||||
|
|
||||||
std::vector<VehicleWheelState> wheels_;
|
std::vector<VehicleWheelState> wheels_;
|
||||||
|
|
||||||
|
|||||||
@ -14,6 +14,8 @@ static float game::VehicleTuningContext::* GetCtxVariablePointer(const std::stri
|
|||||||
return &game::VehicleTuningContext::braking_force;
|
return &game::VehicleTuningContext::braking_force;
|
||||||
if (name == "health")
|
if (name == "health")
|
||||||
return &game::VehicleTuningContext::health;
|
return &game::VehicleTuningContext::health;
|
||||||
|
if (name == "steering")
|
||||||
|
return &game::VehicleTuningContext::steering;
|
||||||
|
|
||||||
throw std::runtime_error("tuning list: invalid variable " + name);
|
throw std::runtime_error("tuning list: invalid variable " + name);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -35,6 +35,7 @@ struct VehicleTuningContext
|
|||||||
float engine_force;
|
float engine_force;
|
||||||
float braking_force;
|
float braking_force;
|
||||||
float health;
|
float health;
|
||||||
|
float steering;
|
||||||
std::vector<VehicleWheelTuningContext> wheels;
|
std::vector<VehicleWheelTuningContext> wheels;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user