CARLA
 
载入中...
搜索中...
未找到
Weather.h
浏览该文件的文档.
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 "GameFramework/Actor.h"
11
12// 该头文件加入了反射系统
13#include "Weather.generated.h"
14
15class ASensor;
17
18UCLASS(Abstract)
19class CARLA_API AWeather : public AActor
20{
21 GENERATED_BODY()
22
23public:
24
25 AWeather(const FObjectInitializer& ObjectInitializer);
26
27 /// 更新天气参数并将其通知到蓝图的事件
28 UFUNCTION(BlueprintCallable)
29 void ApplyWeather(const FWeatherParameters &WeatherParameters);
30
31 /// 将天气通知到蓝图的事件
32 void NotifyWeather(ASensor* Sensor = nullptr);
33
34 /// 在不通知蓝图事件的情况下更新天气参数
35 UFUNCTION(BlueprintCallable)
36 void SetWeather(const FWeatherParameters &WeatherParameters);
37
38 /// 返回当前的 天气参数 WeatherParameters
39 UFUNCTION(BlueprintCallable)
40 const FWeatherParameters &GetCurrentWeather() const
41 {
42 return Weather;
43 }
44
45 /// 返回昼夜循环是否有效(切换到夜间模式时自动 开/关 切换)
46 UFUNCTION(BlueprintCallable)
47 const bool &GetDayNightCycle() const
48 {
49 return DayNightCycle;
50 }
51
52 /// 更新昼夜周期
53 void SetDayNightCycle(const bool &active);
54
55protected:
56
57 UFUNCTION(BlueprintImplementableEvent)
58 // 这是一个在蓝图中可实现的事件
59 // 刷新天气参数
60 void RefreshWeather(const FWeatherParameters &WeatherParameters);
61
62private:
63
64 // 检查天气后处理效果
65 void CheckWeatherPostProcessEffects();
66
67 // 这是一个在任何地方都可见的属性(Weather.cpp中使用了)
68 // 天气参数
69 UPROPERTY(VisibleAnywhere)
71
72 // 材质指针,用于降水后处理
73 UMaterial* PrecipitationPostProcessMaterial;
74
75 // 材质指针,用于沙尘暴后处理
76 UMaterial* DustStormPostProcessMaterial;
77
78
79 // 映射,键是材质指针,值是浮点数
80 // 活动混合
81 TMap<UMaterial*, float> ActiveBlendables;
82
83 UPROPERTY(EditAnywhere, Category = "Weather")
84 // 这是一个在任何地方都可编辑的属性,分类为"Weather"
85 // 日夜循环是否启用
86 bool DayNightCycle = true;
87};
return true
捕捉场景图像的传感器"