CARLA
GearPhysicsControl.h
Go to the documentation of this file.
1 // Copyright (c) 2019 Intel Corporation
2 //
3 // This work is licensed under the terms of the MIT license.
4 // For a copy, see <https://opensource.org/licenses/MIT>.
5 
6 #pragma once
7 
8 #include "carla/MsgPack.h"
9 #ifdef LIBCARLA_INCLUDED_FROM_UE4
13 #endif
14 
15 namespace carla {
16 namespace rpc {
17 
19  public:
20 
21  GearPhysicsControl() = default;
22 
24  float in_ratio,
25  float in_down_ratio,
26  float in_up_ratio)
27  : ratio(in_ratio),
28  down_ratio(in_down_ratio),
29  up_ratio(in_up_ratio) {}
30 
31  float ratio = 1.0f;
32  float down_ratio = 0.5f;
33  float up_ratio = 0.65f;
34 
35  bool operator!=(const GearPhysicsControl &rhs) const {
36  return
37  ratio != rhs.ratio ||
38  down_ratio != rhs.down_ratio ||
39  up_ratio != rhs.up_ratio;
40  }
41 
42  bool operator==(const GearPhysicsControl &rhs) const {
43  return !(*this != rhs);
44  }
45 #ifdef LIBCARLA_INCLUDED_FROM_UE4
46 
48  : ratio(Gear.Ratio),
49  down_ratio(Gear.DownRatio),
50  up_ratio(Gear.UpRatio) {}
51 
52  operator FGearPhysicsControl() const {
54  Gear.Ratio = ratio;
55  Gear.DownRatio = down_ratio;
56  Gear.UpRatio = up_ratio;
57  return Gear;
58  }
59 #endif
60 
61  MSGPACK_DEFINE_ARRAY(ratio,
62  down_ratio,
63  up_ratio)
64  };
65 
66 }
67 }
GearPhysicsControl(float in_ratio, float in_down_ratio, float in_up_ratio)
bool operator==(const GearPhysicsControl &rhs) const
This file contains definitions of common data structures used in traffic manager. ...
Definition: Carla.cpp:133
bool operator!=(const GearPhysicsControl &rhs) const