5#include "Containers/Array.h"
12#if VEHICLE_DEBUGGING_ENABLED
87 , MaxSteeringAngle(70)
88 , MaxBrakeTorque(2000.f)
89 , HandbrakeTorque(1000.f)
92 , HandbrakeEnabled(
true)
93 , SteeringEnabled(
true)
94 , EngineEnabled(
false)
95 , TractionControlEnabled(
false)
100 , FrictionMultiplier(2.0f)
101 , LateralSlipGraphMultiplier(1.0f)
102 , CorneringStiffness(1000.0f)
103 , SideSlipModifier(1.0f)
104 , SlipThreshold(20.0f)
105 , SkidThreshold(20.0f)
106 , MaxSpinRotation(30.0f)
224 GroundVelocityVector =
VIn;
275 FVehicleUtility::ClampNormalRange(
SlipIn);
286 return ForceFromFriction;
298 return AngularPosition;
321 return (FMath::Abs(GetSlipMagnitude()) > Setup().SlipThreshold);
326 return (FMath::Abs(GetSkidMagnitude()) > Setup().SkidThreshold);
330 return bABSActivated;
335 return SteeringAngle;
352 return ForceIntoSurface;
358 return SurfaceFriction;
382 return GroundVelocityVector.X;
395 return GetWheelGroundSpeed() - GetRoadSpeed();
402 return GroundVelocityVector.Y;
412 void Simulate(
float DeltaTime);
499#if VEHICLE_DEBUGGING_ENABLED
#define UE_ENABLE_OPTIMIZATION
Definition CoreMiscDefines.h:60
#define UE_DISABLE_OPTIMIZATION
Definition CoreMiscDefines.h:59
UE_FORCEINLINE_HINT TSharedRef< CastToType, Mode > StaticCastSharedRef(TSharedRef< CastFromType, Mode > const &InSharedRef)
Definition SharedPointer.h:127
return true
Definition ExternalRpcRegistry.cpp:601
#define SMALL_NUMBER
Definition UnrealMathUtility.h:66
uint32 Offset
Definition VulkanMemory.cpp:4033
Definition WheelSystem.h:486
FAxleConfig Setup
Definition WheelSystem.h:493
void Simulate(float DeltaTime)
Definition WheelSystem.h:491
Definition VehicleUtility.h:89
Definition WheelSystem.h:161
void SetBrakeTorqueOverride(float BrakeTorqueIn, bool bEngineBrakingIn=false)
Definition WheelSystem.h:210
float GetSurfaceFriction() const
Definition WheelSystem.h:356
float GetSlipAngle() const
Definition WheelSystem.h:362
float HandbrakeTorque
Definition WheelSystem.h:432
bool bEngineBraking
Definition WheelSystem.h:461
void SetVehicleGroundSpeed(const FVector &VIn)
Definition WheelSystem.h:222
float MaxSteeringAngle
Definition WheelSystem.h:430
float MaxOmega
Definition WheelSystem.h:447
void SetDriveTorqueOverride(float EngineTorqueIn)
Definition WheelSystem.h:216
void SetDriveTorque(float EngineTorqueIn)
Definition WheelSystem.h:200
FSimpleWheelConfig::EExternalTorqueCombineMethod ExternalTorqueCombineMethod
Definition WheelSystem.h:433
bool IsSkidding() const
Definition WheelSystem.h:324
uint32 WheelIndex
Definition WheelSystem.h:460
void SetWheelRadius(float NewRadius)
Definition WheelSystem.h:169
FVector GroundVelocityVector
Definition WheelSystem.h:443
float SlipAngle
Definition WheelSystem.h:458
bool TractionControlEnabled
Definition WheelSystem.h:425
bool bClipping
Definition WheelSystem.h:473
void SetMassPerWheel(float VehicleMassPerWheel)
Definition WheelSystem.h:415
float AppliedLinearBrakeForce
Definition WheelSystem.h:466
float Inertia
Definition WheelSystem.h:438
void SetTorqueCombineMethod(FSimpleWheelConfig::EExternalTorqueCombineMethod InCombineMethod)
Definition WheelSystem.h:205
float LongitudinalAdhesiveLimit
Definition WheelSystem.h:467
bool HandbrakeEnabled
Definition WheelSystem.h:422
float GetAngularPosition() const
Definition WheelSystem.h:296
bool EngineEnabled
Definition WheelSystem.h:424
void SetMatchingSpeed(float LinearMetersPerSecondIn)
Definition WheelSystem.h:187
float LateralSlipGraphMultiplier
Definition WheelSystem.h:428
float FrictionMultiplier
Definition WheelSystem.h:427
float LateralAdhesiveLimit
Definition WheelSystem.h:468
bool bInContact
Definition WheelSystem.h:459
float GetWheelRPM()
Definition WheelSystem.h:308
float GetBrakeTorque() const
Definition WheelSystem.h:374
float ExternalBrakeTorque
Definition WheelSystem.h:450
float Sx
Definition WheelSystem.h:437
float Omega
Definition WheelSystem.h:436
void SetOnGround(bool OnGround)
Definition WheelSystem.h:248
bool ABSEnabled
Definition WheelSystem.h:426
float DriveTorque
Definition WheelSystem.h:440
FVector GetForceFromFriction() const
Definition WheelSystem.h:284
float SlipVelocity
Definition WheelSystem.h:457
void SetSurfaceFriction(float InFriction)
Definition WheelSystem.h:243
float MaxBrakeTorque
Definition WheelSystem.h:431
float BrakeTorque
Definition WheelSystem.h:441
float GetNormalizedLateralSlip() const
Definition WheelSystem.h:344
float GetDriveTorque() const
Definition WheelSystem.h:368
bool SteeringEnabled
Definition WheelSystem.h:423
float GetSkidMagnitude() const
Definition WheelSystem.h:400
bool IsSlipping() const
Definition WheelSystem.h:319
float AvailableGrip
Definition WheelSystem.h:471
float AppliedLinearDriveForce
Definition WheelSystem.h:465
float SteeringAngle
Definition WheelSystem.h:445
float GetRoadSpeed() const
Definition WheelSystem.h:380
float SurfaceFriction
Definition WheelSystem.h:446
bool InContact() const
Definition WheelSystem.h:314
float GetAngularVelocity() const
Definition WheelSystem.h:302
float AngularPosition
Definition WheelSystem.h:444
bool bABSActivated
Definition WheelSystem.h:474
bool IsABSActivated() const
Definition WheelSystem.h:328
float Spin
Definition WheelSystem.h:470
static float GetNormalisedFrictionFromSlipAngle(float SlipIn)
Definition WheelSystem.h:273
void SetWheelIndex(uint32 InIndex)
Definition WheelSystem.h:263
float MassPerWheel
Definition WheelSystem.h:453
float GetWheelLoadForce() const
Definition WheelSystem.h:350
void SetWheelLoadForce(float WheelLoadForceIn)
Definition WheelSystem.h:228
void SetBrakeTorque(float BrakeTorqueIn, bool bEngineBrakingIn=false)
Definition WheelSystem.h:193
float ExternalDriveTorque
Definition WheelSystem.h:449
void SetMaxOmega(float InMaxOmega)
Definition WheelSystem.h:258
FVector InputForces
Definition WheelSystem.h:472
float Re
Definition WheelSystem.h:435
float GetSlipMagnitude() const
Definition WheelSystem.h:393
float ForceIntoSurface
Definition WheelSystem.h:442
float SideSlipModifier
Definition WheelSystem.h:469
void SetSteeringAngle(float InAngle)
Definition WheelSystem.h:253
float GetSteeringAngle() const
Definition WheelSystem.h:333
float CorneringStiffness
Definition WheelSystem.h:429
float GetWheelGroundSpeed() const
Definition WheelSystem.h:386
void SetAngularVelocity(float AngularVelocityIn)
Definition WheelSystem.h:181
float GetNormalizedLongitudinalSlip() const
Definition WheelSystem.h:339
bool BrakeEnabled
Definition WheelSystem.h:421
FVector ForceFromFriction
Definition WheelSystem.h:452
float GetEffectiveRadius() const
Definition WheelSystem.h:290
void SetAngularPosition(float PositionIn)
Definition WheelSystem.h:175
Definition VehicleSystemTemplate.h:13
Definition SkeletalMeshComponent.h:307
FORCEINLINE float RadToDeg(float InRad)
Definition VehicleUtility.h:282
FORCEINLINE float OmegaToRPM(float Omega)
Definition VehicleUtility.h:181
@ false
Definition radaudio_common.h:23
Definition WheelSystem.h:480
float RollbarScaling
Definition WheelSystem.h:482
TArray< uint16 > WheelIndex
Definition WheelSystem.h:481
Definition WheelSystem.h:43
FSimpleWheelConfig()
Definition WheelSystem.h:82
float TorqueRatio
Definition WheelSystem.h:133
EAxleType AxleType
Definition WheelSystem.h:135
EExternalTorqueCombineMethod ExternalTorqueCombineMethod
Definition WheelSystem.h:138
EExternalTorqueCombineMethod
Definition WheelSystem.h:76
@ Override
Definition WheelSystem.h:78
float WheelWidth
Definition WheelSystem.h:118
FVector Offset
Definition WheelSystem.h:115
float SlipThreshold
Definition WheelSystem.h:145
bool SteeringEnabled
Definition WheelSystem.h:130
EFrictionCombineMethod FrictionCombineMethod
Definition WheelSystem.h:137
FGraph LateralSlipGraph
Definition WheelSystem.h:148
float LateralSlipGraphMultiplier
Definition WheelSystem.h:141
bool HandbrakeEnabled
Definition WheelSystem.h:129
bool ABSEnabled
Definition WheelSystem.h:125
int MaxSteeringAngle
Definition WheelSystem.h:120
float HandbrakeTorque
Definition WheelSystem.h:124
float MaxBrakeTorque
Definition WheelSystem.h:123
float SideSlipModifier
Definition WheelSystem.h:143
float CorneringStiffness
Definition WheelSystem.h:142
float SkidThreshold
Definition WheelSystem.h:146
float WheelRadius
Definition WheelSystem.h:117
EFrictionCombineMethod
Definition WheelSystem.h:63
@ Multiply
Definition WheelSystem.h:64
float WheelMass
Definition WheelSystem.h:116
EAxleType
Definition WheelSystem.h:69
@ Front
Definition WheelSystem.h:71
EWheelSimulationStatus
Definition WheelSystem.h:55
@ SPINNING
Definition WheelSystem.h:57
@ ROLLING
Definition WheelSystem.h:56
bool TractionControlEnabled
Definition WheelSystem.h:132
float FrictionMultiplier
Definition WheelSystem.h:140
bool EngineEnabled
Definition WheelSystem.h:131
float MaxSpinRotation
Definition WheelSystem.h:149
EWheelDamageStatus
Definition WheelSystem.h:46
@ BUCKLED
Definition WheelSystem.h:48
@ FLAT
Definition WheelSystem.h:49
@ NONE
Definition WheelSystem.h:47
bool BrakeEnabled
Definition WheelSystem.h:128
static constexpr UE_FORCEINLINE_HINT T Clamp(const T X, const T MinValue, const T MaxValue)
Definition UnrealMathUtility.h:592