This commit is contained in:
2025-11-25 19:16:40 +07:00
parent 68626640c2
commit e12b75be45
11 changed files with 119 additions and 107 deletions

View File

@@ -15,7 +15,7 @@ public partial class VeloXCar
if ( !UseABS )
return;
if ( TotalSpeed < 100 || ABSActive || Steering.AlmostEqual( 0, 1 ) )
if ( TotalSpeed < 100 || Steering.AlmostEqual( 0, 1 ) )
return;
@@ -26,10 +26,10 @@ public partial class VeloXCar
if ( !wheel.IsOnGround )
continue;
if ( wheel.NormalizedLongitudinalSlip >= 0.55f )
if ( wheel.wheelIsBlocked )
{
ABSActive = true;
wheel.BrakeTorque *= 0.25f;
wheel.BrakeTorque = 0f;
}
}

View File

@@ -24,6 +24,15 @@ public partial class VeloXCar
angle -= SteerAngle.yaw * 0.5f;
float absAngle = angle < 0 ? -angle : angle;
//foreach ( var wheel in Wheels )
//{
// if ( !wheel.IsOnGround )
// continue;
// Log.Info( wheel.LongitudinalSlip < 0.1f );
// if ( wheel.LongitudinalSlip < 0.1f )
// wheel.BrakeTorque += Math.Abs( wheel.LongitudinalSlip ) * 10000;
//}
if ( Engine.RevLimiterActive || absAngle < 2f )
return;
@@ -32,7 +41,6 @@ public partial class VeloXCar
if ( !wheel.IsOnGround )
continue;
float additionalBrakeTorque = -angle * Math.Sign( wheel.LocalPosition.y ) * 20f;
if ( additionalBrakeTorque > 0 )
{

View File

@@ -38,7 +38,7 @@ public partial class VeloXCar : VeloXBase
if ( Math.Abs( inputSteer ) < 0.1f )
return;
if ( IsOnGround && Math.Abs( WorldRotation.Roll() ) < 60 )
if ( IsOnGround || Math.Abs( WorldRotation.Roll() ) < 60 )
return;
var angVel = Body.WorldTransform.PointToLocal( WorldPosition + Body.AngularVelocity );