Add LongitudinalSlip/LateralSlip to wheel state
This commit is contained in:
@@ -402,6 +402,16 @@ API_CLASS(Attributes="ActorContextMenu(\"New/Physics/Wheeled Vehicle\"), ActorTo
|
||||
/// </summary>
|
||||
API_FIELD() float SuspensionOffset = 0.0f;
|
||||
|
||||
/// <summary>
|
||||
/// The longitudinal slip of the tire (frontal). Can be used to determine whether the tire is slipping or gripping the surface.
|
||||
/// </summary>
|
||||
API_FIELD() float LongitudinalSlip = 0.0f;
|
||||
|
||||
/// <summary>
|
||||
/// The lateral slip of the tire (sideways). Can be used to determine whether the tire is slipping or gripping the surface.
|
||||
/// </summary>
|
||||
API_FIELD() float LateralSlip = 0.0f;
|
||||
|
||||
#if USE_EDITOR
|
||||
/// <summary>
|
||||
/// The start location of the suspension raycast start (Editor only for debugging).
|
||||
|
||||
@@ -1175,6 +1175,8 @@ void ScenePhysX::UpdateVehicles(float dt)
|
||||
state.SteerAngle = RadiansToDegrees * perWheel.steerAngle;
|
||||
state.RotationAngle = -RadiansToDegrees * drive->mWheelsDynData.getWheelRotationAngle(j);
|
||||
state.SuspensionOffset = perWheel.suspJounce;
|
||||
state.LongitudinalSlip = perWheel.longitudinalSlip;
|
||||
state.LateralSlip = perWheel.lateralSlip;
|
||||
#if USE_EDITOR
|
||||
state.SuspensionTraceStart = P2C(perWheel.suspLineStart) + Origin;
|
||||
state.SuspensionTraceEnd = P2C(perWheel.suspLineStart + perWheel.suspLineDir * perWheel.suspLineLength) + Origin;
|
||||
|
||||
Reference in New Issue
Block a user