28 const std::vector<carla::geom::Vector2D> &in_torque_curve,
31 float in_damping_rate_full_throttle,
32 float in_damping_rate_zero_throttle_clutch_engaged,
33 float in_damping_rate_zero_throttle_clutch_disengaged,
35 bool in_use_gear_autobox,
36 float in_gear_switch_time,
37 float in_clutch_strength,
39 std::vector<GearPhysicsControl> &in_forward_gears,
42 float in_drag_coefficient,
44 const std::vector<carla::geom::Vector2D> &in_steering_curve,
45 std::vector<WheelPhysicsControl> &in_wheels,
46 bool in_use_sweep_wheel_collision)
73 const std::vector<WheelPhysicsControl> &
GetWheels()
const {
77 void SetWheels(std::vector<WheelPhysicsControl> &in_wheels) {
151 return !(*
this != rhs);
154#ifdef LIBCARLA_INCLUDED_FROM_UE4
160 TArray<FRichCurveKey> TorqueCurveKeys =
Control.TorqueCurve.GetCopyOfKeys();
161 for (int32 KeyIdx = 0; KeyIdx < TorqueCurveKeys.Num(); KeyIdx++) {
162 geom::Vector2D point(TorqueCurveKeys[KeyIdx].Time, TorqueCurveKeys[KeyIdx].Value);
177 for (
const auto &Gear :
Control.ForwardGears) {
186 TArray<FRichCurveKey> SteeringCurveKeys =
Control.SteeringCurve.GetCopyOfKeys();
187 for (int32 KeyIdx = 0; KeyIdx < SteeringCurveKeys.Num(); KeyIdx++) {
188 geom::Vector2D point(SteeringCurveKeys[KeyIdx].Time, SteeringCurveKeys[KeyIdx].Value);
195 wheels = std::vector<WheelPhysicsControl>();
196 for (
const auto &Wheel :
Control.Wheels) {
207 FRichCurve TorqueCurve;
209 TorqueCurve.AddKey(point.x, point.y);
211 Control.TorqueCurve = TorqueCurve;
223 TArray<FGearPhysicsControl> ForwardGears;
227 Control.ForwardGears = ForwardGears;
235 FRichCurve SteeringCurve;
237 SteeringCurve.AddKey(point.x, point.y);
239 Control.SteeringCurve = SteeringCurve;
244 TArray<FWheelPhysicsControl> Wheels;
245 for (
const auto &wheel :
wheels) {
std::vector< geom::Vector2D > steering_curve
bool GetUseSweepWheelCollision()
bool operator==(const VehiclePhysicsControl &rhs) const
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)
float damping_rate_zero_throttle_clutch_disengaged
const std::vector< geom::Vector2D > & GetSteeringCurve() const
void SetTorqueCurve(std::vector< geom::Vector2D > &in_torque_curve)
std::vector< WheelPhysicsControl > wheels
const std::vector< WheelPhysicsControl > & GetWheels() const
float damping_rate_full_throttle
bool operator!=(const VehiclePhysicsControl &rhs) const
float damping_rate_zero_throttle_clutch_engaged
std::vector< GearPhysicsControl > forward_gears
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)
VehiclePhysicsControl()=default
void SetSteeringCurve(std::vector< geom::Vector2D > &in_steering_curve)
bool use_sweep_wheel_collision
const std::vector< GearPhysicsControl > & GetForwardGears() const
std::vector< geom::Vector2D > torque_curve
void SetUseSweepWheelCollision(bool in_sweep)
VehiclePhysicsControl(const FVehiclePhysicsControl &Control)
const std::vector< geom::Vector2D > & GetTorqueCurve() const
geom::Location center_of_mass
void SetForwardGears(std::vector< GearPhysicsControl > &in_forward_gears)
void SetWheels(std::vector< WheelPhysicsControl > &in_wheels)