Hi guys,
I’m trying to understand the logic implemented in Chaos Vehicle plugin? I need your help with following points:
1/ Torque conversion
If I’m not wrong then brake torque unit is Nm, then convert to Ncm required multiply by 100. But as shown in the code, the brake torque is multiplied by 10000
UE_5.4\Engine\Plugins\Experimental\ChaosVehiclesPlugin\Source\ChaosVehicles\Private\ChaosWheeledVehicleMovementComponent.cpp
if (PWheel.BrakeEnabled)
{
float BrakeForce = PWheel.MaxBrakeTorque * ModifiedInputs.BrakeInput;
PWheel.SetBrakeTorque(TorqueMToCm(BrakeForce + EngineBrakingForce), FMath::Abs(EngineBrakingForce) > FMath::Abs(BrakeForce));
}
else
{
PWheel.SetBrakeTorque(TorqueMToCm(EngineBraking), true);
}
UE_5.4\Engine\Source\Runtime\Experimental\ChaosVehicles\ChaosVehiclesCore\Public\VehicleUtility.h
FORCEINLINE float TorqueMToCm(float TorqueIn)
{
return TorqueIn * 10000.0f;
}
2/ Force required to stop a wheel
What is the meaning of K? is it some kind of friction coefficient, why is the value set to 0.4?
UE_5.4\Engine\Source\Runtime\Experimental\ChaosVehicles\ChaosVehiclesCore\Private\WheelSystem.cpp
void FSimpleWheelSim::Simulate(float DeltaTime)
{
float K = 0.4f;
float TractionControlAndABSScaling = 0.98f;
// how close to perfection is the system working
if (Braking)
{
// whether the velocity is +ve or -ve when we brake we are slowing the vehicle down
// so force is opposing current direction of travel.
float ForceRequiredToBringToStop = MassPerWheel * K * (LocalWheelVelocity.X) / DeltaTime;
FinalLongitudinalForce = AppliedLinearBrakeForce;