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 
46 
47  /// @}
48 
49  WeatherParameters() = default;
50 
52  float in_cloudiness,
53  float in_precipitation,
54  float in_precipitation_deposits,
55  float in_wind_intensity,
56  float in_sun_azimuth_angle,
57  float in_sun_altitude_angle,
58  float in_fog_density,
59  float in_fog_distance,
60  float in_fog_falloff,
61  float in_wetness,
62  float in_scattering_intensity,
63  float in_mie_scattering_scale,
64  float in_rayleigh_scattering_scale)
65  : cloudiness(in_cloudiness),
66  precipitation(in_precipitation),
67  precipitation_deposits(in_precipitation_deposits),
68  wind_intensity(in_wind_intensity),
69  sun_azimuth_angle(in_sun_azimuth_angle),
70  sun_altitude_angle(in_sun_altitude_angle),
71  fog_density(in_fog_density),
72  fog_distance(in_fog_distance),
73  fog_falloff(in_fog_falloff),
74  wetness(in_wetness),
75  scattering_intensity(in_scattering_intensity),
76  mie_scattering_scale(in_mie_scattering_scale),
77  rayleigh_scattering_scale(in_rayleigh_scattering_scale) {}
78 
79  float cloudiness = 0.0f;
80  float precipitation = 0.0f;
81  float precipitation_deposits = 0.0f;
82  float wind_intensity = 0.0f;
83  float sun_azimuth_angle = 0.0f;
84  float sun_altitude_angle = 0.0f;
85  float fog_density = 0.0f;
86  float fog_distance = 0.0f;
87  float fog_falloff = 0.0f;
88  float wetness = 0.0f;
89  float scattering_intensity = 0.0f;
90  float mie_scattering_scale = 0.0f;
91  float rayleigh_scattering_scale = 0.0331f;
92 
93 #ifdef LIBCARLA_INCLUDED_FROM_UE4
94 
96  : cloudiness(Weather.Cloudiness),
97  precipitation(Weather.Precipitation),
98  precipitation_deposits(Weather.PrecipitationDeposits),
99  wind_intensity(Weather.WindIntensity),
100  sun_azimuth_angle(Weather.SunAzimuthAngle),
101  sun_altitude_angle(Weather.SunAltitudeAngle),
102  fog_density(Weather.FogDensity),
103  fog_distance(Weather.FogDistance),
104  fog_falloff(Weather.FogFalloff),
105  wetness(Weather.Wetness),
106  scattering_intensity(Weather.ScatteringIntensity),
107  mie_scattering_scale(Weather.MieScatteringScale),
108  rayleigh_scattering_scale(Weather.RayleighScatteringScale) {}
109 
110  operator FWeatherParameters() const {
111  FWeatherParameters Weather;
112  Weather.Cloudiness = cloudiness;
113  Weather.Precipitation = precipitation;
115  Weather.WindIntensity = wind_intensity;
118  Weather.FogDensity = fog_density;
119  Weather.FogDistance = fog_distance;
120  Weather.FogFalloff = fog_falloff;
121  Weather.Wetness = wetness;
125 
126  return Weather;
127  }
128 
129 #endif // LIBCARLA_INCLUDED_FROM_UE4
130 
131  bool operator!=(const WeatherParameters &rhs) const {
132  return
133  cloudiness != rhs.cloudiness ||
134  precipitation != rhs.precipitation ||
135  precipitation_deposits != rhs.precipitation_deposits ||
136  wind_intensity != rhs.wind_intensity ||
137  sun_azimuth_angle != rhs.sun_azimuth_angle ||
138  sun_altitude_angle != rhs.sun_altitude_angle ||
139  fog_density != rhs.fog_density ||
140  fog_distance != rhs.fog_distance ||
141  fog_falloff != rhs.fog_falloff ||
142  wetness != rhs.wetness ||
143  scattering_intensity != rhs.scattering_intensity ||
144  mie_scattering_scale != rhs.mie_scattering_scale ||
145  rayleigh_scattering_scale != rhs.rayleigh_scattering_scale;
146  }
147 
148  bool operator==(const WeatherParameters &rhs) const {
149  return !(*this != rhs);
150  }
151 
153  cloudiness,
154  precipitation,
155  precipitation_deposits,
156  wind_intensity,
157  sun_azimuth_angle,
158  sun_altitude_angle,
159  fog_density,
160  fog_distance,
161  fog_falloff,
162  wetness,
163  scattering_intensity,
164  mie_scattering_scale,
165  rayleigh_scattering_scale);
166  };
167 
168 } // namespace rpc
169 } // namespace carla
MSGPACK_DEFINE_ARRAY(cloudiness, precipitation, precipitation_deposits, wind_intensity, sun_azimuth_angle, sun_altitude_angle, fog_density, fog_distance, fog_falloff, wetness, scattering_intensity, mie_scattering_scale, rayleigh_scattering_scale)
This file contains definitions of common data structures used in traffic manager. ...
Definition: Carla.cpp:133
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, float in_scattering_intensity, float in_mie_scattering_scale, float in_rayleigh_scattering_scale)
bool operator!=(const WeatherParameters &rhs) const