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 
10 namespace carla {
11 namespace rpc {
12 
14  public:
15 
16  GearPhysicsControl() = default;
17 
19  float in_ratio,
20  float in_down_ratio,
21  float in_up_ratio)
22  : ratio(in_ratio),
23  down_ratio(in_down_ratio),
24  up_ratio(in_up_ratio) {}
25 
26  float ratio = 1.0f;
27  float down_ratio = 0.5f;
28  float up_ratio = 0.65f;
29 
30  bool operator!=(const GearPhysicsControl &rhs) const {
31  return
32  ratio != rhs.ratio ||
33  down_ratio != rhs.down_ratio ||
34  up_ratio != rhs.up_ratio;
35  }
36 
37  bool operator==(const GearPhysicsControl &rhs) const {
38  return !(*this != rhs);
39  }
40 #ifdef LIBCARLA_INCLUDED_FROM_UE4
41 
43  : ratio(Gear.Ratio),
44  down_ratio(Gear.DownRatio),
45  up_ratio(Gear.UpRatio) {}
46 
47  operator FGearPhysicsControl() const {
49  Gear.Ratio = ratio;
50  Gear.DownRatio = down_ratio;
51  Gear.UpRatio = up_ratio;
52  return Gear;
53  }
54 #endif
55 
56  MSGPACK_DEFINE_ARRAY(ratio,
57  down_ratio,
58  up_ratio)
59  };
60 
61 }
62 }
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:99
bool operator!=(const GearPhysicsControl &rhs) const