CARLA
LibCarla/source/carla/rpc/WeatherParameters.h
Go to the documentation of this file.
1 // Copyright (c) 2017 Computer Vision Center (CVC) at the Universitat Autonoma
2 // de Barcelona (UAB).
3 //
4 // This work is licensed under the terms of the MIT license.
5 // For a copy, see <https://opensource.org/licenses/MIT>.
6 
7 #pragma once
8 
9 #include "carla/MsgPack.h"
10 
11 #ifdef LIBCARLA_INCLUDED_FROM_UE4
13 #endif // LIBCARLA_INCLUDED_FROM_UE4
14 
15 namespace carla {
16 namespace rpc {
17 
19  public:
20 
21  /// @name Weather presets
22  /// @{
23 
39 
40  /// @}
41 
42  WeatherParameters() = default;
43 
45  float in_cloudiness,
46  float in_precipitation,
47  float in_precipitation_deposits,
48  float in_wind_intensity,
49  float in_sun_azimuth_angle,
50  float in_sun_altitude_angle,
51  float in_fog_density,
52  float in_fog_distance,
53  float in_fog_falloff,
54  float in_wetness)
55  : cloudiness(in_cloudiness),
56  precipitation(in_precipitation),
57  precipitation_deposits(in_precipitation_deposits),
58  wind_intensity(in_wind_intensity),
59  sun_azimuth_angle(in_sun_azimuth_angle),
60  sun_altitude_angle(in_sun_altitude_angle),
61  fog_density(in_fog_density),
62  fog_distance(in_fog_distance),
63  fog_falloff(in_fog_falloff),
64  wetness(in_wetness) {}
65 
66  float cloudiness = 0.0f;
67  float precipitation = 0.0f;
68  float precipitation_deposits = 0.0f;
69  float wind_intensity = 0.0f;
70  float sun_azimuth_angle = 0.0f;
71  float sun_altitude_angle = 0.0f;
72  float fog_density = 0.0f;
73  float fog_distance = 0.0f;
74  float fog_falloff = 0.0f;
75  float wetness = 0.0f;
76 
77 #ifdef LIBCARLA_INCLUDED_FROM_UE4
78 
80  : cloudiness(Weather.Cloudiness),
81  precipitation(Weather.Precipitation),
82  precipitation_deposits(Weather.PrecipitationDeposits),
83  wind_intensity(Weather.WindIntensity),
84  sun_azimuth_angle(Weather.SunAzimuthAngle),
85  sun_altitude_angle(Weather.SunAltitudeAngle),
86  fog_density(Weather.FogDensity),
87  fog_distance(Weather.FogDistance),
88  fog_falloff(Weather.FogFalloff),
89  wetness(Weather.Wetness) {}
90 
91  operator FWeatherParameters() const {
92  FWeatherParameters Weather;
93  Weather.Cloudiness = cloudiness;
94  Weather.Precipitation = precipitation;
96  Weather.WindIntensity = wind_intensity;
99  Weather.FogDensity = fog_density;
100  Weather.FogDistance = fog_distance;
101  Weather.FogFalloff = fog_falloff;
102  Weather.Wetness = wetness;
103  return Weather;
104  }
105 
106 #endif // LIBCARLA_INCLUDED_FROM_UE4
107 
108  bool operator!=(const WeatherParameters &rhs) const {
109  return
110  cloudiness != rhs.cloudiness ||
111  precipitation != rhs.precipitation ||
112  precipitation_deposits != rhs.precipitation_deposits ||
113  wind_intensity != rhs.wind_intensity ||
114  sun_azimuth_angle != rhs.sun_azimuth_angle ||
115  sun_altitude_angle != rhs.sun_altitude_angle ||
116  fog_density != rhs.fog_density ||
117  fog_distance != rhs.fog_distance ||
118  fog_falloff != rhs.fog_falloff ||
119  wetness != rhs.wetness;
120  }
121 
122  bool operator==(const WeatherParameters &rhs) const {
123  return !(*this != rhs);
124  }
125 
127  cloudiness,
128  precipitation,
129  precipitation_deposits,
130  wind_intensity,
131  sun_azimuth_angle,
132  sun_altitude_angle,
133  fog_density,
134  fog_distance,
135  fog_falloff,
136  wetness);
137  };
138 
139 } // namespace rpc
140 } // namespace carla
This file contains definitions of common data structures used in traffic manager. ...
Definition: Carla.cpp:99
MSGPACK_DEFINE_ARRAY(cloudiness, precipitation, precipitation_deposits, wind_intensity, sun_azimuth_angle, sun_altitude_angle, fog_density, fog_distance, fog_falloff, wetness)
bool operator==(const WeatherParameters &rhs) const
WeatherParameters(float in_cloudiness, float in_precipitation, float in_precipitation_deposits, float in_wind_intensity, float in_sun_azimuth_angle, float in_sun_altitude_angle, float in_fog_density, float in_fog_distance, float in_fog_falloff, float in_wetness)
bool operator!=(const WeatherParameters &rhs) const