CARLA
Loading...
Searching...
No Matches
Unreal/CarlaUnreal/Plugins/Carla/Source/Carla/Vehicle/VehiclePhysicsControl.h
Go to the documentation of this file.
1// Copyright (c) 2026 Computer Vision Center (CVC) at the Universitat Autonoma
2// de Barcelona (UAB).
3// Copyright (c) 2019 Intel Corporation
4//
5// This work is licensed under the terms of the MIT license.
6// For a copy, see <https://opensource.org/licenses/MIT>.
7
8#pragma once
9
11
12#include <util/ue-header-guard-begin.h>
13#include "Curves/RichCurve.h"
14#include <util/ue-header-guard-end.h>
15
16#include "VehiclePhysicsControl.generated.h"
17
18
19USTRUCT(BlueprintType)
20struct CARLA_API FVehiclePhysicsControl
21{
22 GENERATED_BODY()
23
24 // MECHANICAL SETUP
25
26 // Engine Setup
27 FRichCurve TorqueCurve;
28
29 UPROPERTY(Category = "Vehicle Engine Physics Control", EditAnywhere, BlueprintReadWrite)
30 float MaxTorque = 300.0f;
31
32 UPROPERTY(Category = "Vehicle Engine Physics Control", EditAnywhere, BlueprintReadWrite)
33 float MaxRPM = 5000.0f;
34
35 UPROPERTY(Category = "Vehicle Engine Physics Control", EditAnywhere, BlueprintReadWrite)
36 float IdleRPM = 1.0f;
37
38 UPROPERTY(Category = "Vehicle Engine Physics Control", EditAnywhere, BlueprintReadWrite)
39 float BrakeEffect = 1.0f;
40
41 UPROPERTY(Category = "Vehicle Engine Physics Control", EditAnywhere, BlueprintReadWrite)
42 float RevUpMOI = 1.0f;
43
44 UPROPERTY(Category = "Vehicle Engine Physics Control", EditAnywhere, BlueprintReadWrite)
45 float RevDownRate = 600.0f;
46
47 // Differential Setup
48 // ToDo: Convert to an enum, see EVehicleDifferential.
49 UPROPERTY(Category = "Vehicle Engine Physics Control", EditAnywhere, BlueprintReadWrite)
50 uint8 DifferentialType = 0;
51
52 UPROPERTY(Category = "Vehicle Engine Physics Control", EditAnywhere, BlueprintReadWrite)
53 float FrontRearSplit = 0.5f;
54
55 // Transmission Setup
56 UPROPERTY(Category = "Vehicle Engine Physics Control", EditAnywhere, BlueprintReadWrite)
57 bool bUseAutomaticGears = true;
58
59 UPROPERTY(Category = "Vehicle Engine Physics Control", EditAnywhere, BlueprintReadWrite)
60 float GearChangeTime = 0.5f;
61
62 UPROPERTY(Category = "Vehicle Engine Physics Control", EditAnywhere, BlueprintReadWrite)
63 float FinalRatio = 4.0f;
64
65 UPROPERTY(Category = "Vehicle Engine Physics Control", EditAnywhere, BlueprintReadWrite)
66 TArray<float> ForwardGearRatios = { 2.85, 2.02, 1.35, 1.0, 2.85, 2.02, 1.35, 1.0 };
67
68 UPROPERTY(Category = "Vehicle Engine Physics Control", EditAnywhere, BlueprintReadWrite)
69 TArray<float> ReverseGearRatios = { 2.86, 2.86 };
70
71 UPROPERTY(Category = "Vehicle Engine Physics Control", EditAnywhere, BlueprintReadWrite)
72 float ChangeUpRPM = 4500.0f;
73
74 UPROPERTY(Category = "Vehicle Engine Physics Control", EditAnywhere, BlueprintReadWrite)
75 float ChangeDownRPM = 2000.0f;
76
77 UPROPERTY(Category = "Vehicle Engine Physics Control", EditAnywhere, BlueprintReadWrite)
78 float TransmissionEfficiency = 0.9f;
79
80 // Vehicle Setup
81 UPROPERTY(Category = "Vehicle Engine Physics Control", EditAnywhere, BlueprintReadWrite)
82 float Mass = 1000.0f;
83
84 UPROPERTY(Category = "Vehicle Engine Physics Control", EditAnywhere, BlueprintReadWrite)
85 float DragCoefficient = 0.3f;
86
87 // Steering Setup
88 FRichCurve SteeringCurve;
89
90 // Center Of Mass
91 UPROPERTY(Category = "Vehicle Engine Physics Control", EditAnywhere, BlueprintReadWrite)
92 FVector CenterOfMass = FVector::ZeroVector;
93
94 UPROPERTY(Category = "Vehicle Engine Physics Control", EditAnywhere, BlueprintReadWrite)
95 float ChassisWidth = 180.f;
96
97 UPROPERTY(Category = "Vehicle Engine Physics Control", EditAnywhere, BlueprintReadWrite)
98 float ChassisHeight = 140.f;
99
100 UPROPERTY(Category = "Vehicle Engine Physics Control", EditAnywhere, BlueprintReadWrite)
101 float DownforceCoefficient = 0.3f;
102
103 UPROPERTY(Category = "Vehicle Engine Physics Control", EditAnywhere, BlueprintReadWrite)
104 float DragArea = 0.0f;
105
106 UPROPERTY(Category = "Vehicle Engine Physics Control", EditAnywhere, BlueprintReadWrite)
107 FVector InertiaTensorScale = FVector(1.0f, 1.0f, 1.0f);
108
109 UPROPERTY(Category = "Vehicle Engine Physics Control", EditAnywhere, BlueprintReadWrite)
110 float SleepThreshold = 10.0f;
111
112 UPROPERTY(Category = "Vehicle Engine Physics Control", EditAnywhere, BlueprintReadWrite)
113 float SleepSlopeLimit = 0.866f; // 30ยบ
114
115 /*
116
117 UPROPERTY(Category = "Vehicle Engine Physics Control", EditAnywhere, BlueprintReadWrite)
118 TArray<FVehicleAerofoilConfig> Aerofoils;
119
120 UPROPERTY(Category = "Vehicle Engine Physics Control", EditAnywhere, BlueprintReadWrite)
121 TArray<FVehicleThrustConfig> Thrusters;
122
123 UPROPERTY(Category = "Vehicle Engine Physics Control", EditAnywhere, BlueprintReadWrite)
124 FVehicleTorqueControlConfig TorqueControl;
125
126 UPROPERTY(Category = "Vehicle Engine Physics Control", EditAnywhere, BlueprintReadWrite)
127 FVehicleTargetRotationControlConfig TargetRotationControl;
128
129 UPROPERTY(Category = "Vehicle Engine Physics Control", EditAnywhere, BlueprintReadWrite)
130 FVehicleStabilizeControlConfig StabilizeControl;
131
132 UPROPERTY(Category = "Vehicle Engine Physics Control", EditAnywhere, BlueprintReadWrite)
133 uint32 VehicleSetupTag;
134
135 */
136
137 // Wheels Setup
138 TArray<FWheelPhysicsControl> Wheels;
139
140 UPROPERTY(Category = "Vehicle Engine Physics Control", EditAnywhere, BlueprintReadWrite)
141 bool UseSweepWheelCollision = false;
142};