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