27 const std::vector<carla::geom::Vector2D> &in_torque_curve,
30 float in_damping_rate_full_throttle,
31 float in_damping_rate_zero_throttle_clutch_engaged,
32 float in_damping_rate_zero_throttle_clutch_disengaged,
34 bool in_use_gear_autobox,
35 float in_gear_switch_time,
36 float in_clutch_strength,
38 std::vector<GearPhysicsControl> &in_forward_gears,
41 float in_drag_coefficient,
43 const std::vector<carla::geom::Vector2D> &in_steering_curve,
44 std::vector<WheelPhysicsControl> &in_wheels,
45 bool in_use_sweep_wheel_collision)
72 const std::vector<WheelPhysicsControl> &
GetWheels()
const {
76 void SetWheels(std::vector<WheelPhysicsControl> &in_wheels) {
149 return !(*
this != rhs);
152 #ifdef LIBCARLA_INCLUDED_FROM_UE4 156 torque_curve = std::vector<carla::geom::Vector2D>();
157 TArray<FRichCurveKey> TorqueCurveKeys = Control.
TorqueCurve.GetCopyOfKeys();
158 for (int32 KeyIdx = 0; KeyIdx < TorqueCurveKeys.Num(); KeyIdx++) {
159 geom::Vector2D point(TorqueCurveKeys[KeyIdx].Time, TorqueCurveKeys[KeyIdx].Value);
160 torque_curve.push_back(point);
173 forward_gears = std::vector<GearPhysicsControl>();
182 steering_curve = std::vector<carla::geom::Vector2D>();
183 TArray<FRichCurveKey> SteeringCurveKeys = Control.
SteeringCurve.GetCopyOfKeys();
184 for (int32 KeyIdx = 0; KeyIdx < SteeringCurveKeys.Num(); KeyIdx++) {
185 geom::Vector2D point(SteeringCurveKeys[KeyIdx].Time, SteeringCurveKeys[KeyIdx].Value);
186 steering_curve.push_back(point);
192 wheels = std::vector<WheelPhysicsControl>();
193 for (
const auto &Wheel : Control.
Wheels) {
204 FRichCurve TorqueCurve;
205 for (
const auto &point : torque_curve) {
206 TorqueCurve.AddKey(point.x, point.y);
220 TArray<FGearPhysicsControl> ForwardGears;
221 for (
const auto &gear : forward_gears) {
232 FRichCurve SteeringCurve;
233 for (
const auto &point : steering_curve) {
234 SteeringCurve.AddKey(point.x, point.y);
241 TArray<FWheelPhysicsControl> Wheels;
242 for (
const auto &wheel : wheels) {
257 damping_rate_full_throttle,
258 damping_rate_zero_throttle_clutch_engaged,
259 damping_rate_zero_throttle_clutch_disengaged,
270 use_sweep_wheel_collision);
VehiclePhysicsControl()=default
void SetSteeringCurve(std::vector< geom::Vector2D > &in_steering_curve)
MSGPACK_DEFINE_ARRAY(torque_curve, max_rpm, moi, damping_rate_full_throttle, damping_rate_zero_throttle_clutch_engaged, damping_rate_zero_throttle_clutch_disengaged, use_gear_autobox, gear_switch_time, clutch_strength, final_ratio, forward_gears, mass, drag_coefficient, center_of_mass, steering_curve, wheels, use_sweep_wheel_collision)
bool operator!=(const VehiclePhysicsControl &rhs) const
This file contains definitions of common data structures used in traffic manager. ...
float DampingRateZeroThrottleClutchEngaged
std::vector< geom::Vector2D > steering_curve
void SetTorqueCurve(std::vector< geom::Vector2D > &in_torque_curve)
bool GetUseSweepWheelCollision()
float DampingRateZeroThrottleClutchDisengaged
std::vector< GearPhysicsControl > forward_gears
void SetUseSweepWheelCollision(bool in_sweep)
float damping_rate_full_throttle
float DampingRateFullThrottle
const std::vector< WheelPhysicsControl > & GetWheels() const
const std::vector< GearPhysicsControl > & GetForwardGears() const
std::vector< WheelPhysicsControl > wheels
TArray< FGearPhysicsControl > ForwardGears
std::vector< geom::Vector2D > torque_curve
float damping_rate_zero_throttle_clutch_engaged
void SetWheels(std::vector< WheelPhysicsControl > &in_wheels)
const std::vector< geom::Vector2D > & GetSteeringCurve() const
const std::vector< geom::Vector2D > & GetTorqueCurve() const
bool use_sweep_wheel_collision
float damping_rate_zero_throttle_clutch_disengaged
VehiclePhysicsControl(const std::vector< carla::geom::Vector2D > &in_torque_curve, float in_max_rpm, float in_moi, float in_damping_rate_full_throttle, float in_damping_rate_zero_throttle_clutch_engaged, float in_damping_rate_zero_throttle_clutch_disengaged, bool in_use_gear_autobox, float in_gear_switch_time, float in_clutch_strength, float in_final_ratio, std::vector< GearPhysicsControl > &in_forward_gears, float in_mass, float in_drag_coefficient, geom::Location in_center_of_mass, const std::vector< carla::geom::Vector2D > &in_steering_curve, std::vector< WheelPhysicsControl > &in_wheels, bool in_use_sweep_wheel_collision)
geom::Location center_of_mass
bool operator==(const VehiclePhysicsControl &rhs) const
bool UseSweepWheelCollision
void SetForwardGears(std::vector< GearPhysicsControl > &in_forward_gears)
TArray< FWheelPhysicsControl > Wheels