CARLA
 
载入中...
搜索中...
未找到
CarlaSettingsDelegate.h
浏览该文件的文档.
1// 版权所有(c)2017巴塞罗那自治大学计算机视觉中心(CVC)
2//
3// 本作品根据麻省理工学院许可条款获得许可
4// 有关副本,请参阅 <https://opensource.org/licenses/MIT>.
5
6#pragma once
7
9
10#include "CoreMinimal.h"
11#include "Engine/StaticMesh.h"
12#include "Engine/World.h"
13
14#include "CarlaSettingsDelegate.generated.h"
15
16class UCarlaSettings;
17
18///用于为生成到世界中的每个角色设置设置
19UCLASS(BlueprintType)
20class CARLA_API UCarlaSettingsDelegate : public UObject
21{
22 GENERATED_BODY()
23
24public:
25
27
28 ///将设置重置为默认值
29 void Reset();
30
31 /// 在此处为所有新生成的参与者创建事件触发器处理程序,以便使用自定义函数进行处理。
32 void RegisterSpawnHandler(UWorld *World);
33
34 /// 加载关卡后,应用当前设置
35 UFUNCTION(BlueprintCallable, Category = "CARLA Settings", meta = (HidePin = "InWorld"))
36 void ApplyQualityLevelPostRestart();
37
38 /// 加载关卡之前,应用当前设置
39 UFUNCTION(BlueprintCallable, Category = "CARLA Settings", meta = (HidePin = "InWorld"))
40 void ApplyQualityLevelPreRestart();
41
42 void SetAllActorsDrawDistance(UWorld *world, float max_draw_distance) const;
43
44private:
45
46 UWorld *GetLocalWorld();
47
48 ///函数应用于正在生成的参与者,以应用当前设置
49 void OnActorSpawned(AActor *Actor);
50
51 /// 检查世界、实例和设置是否有效,并保存CarlaSettings实例
52 ///@param world用于获取CarlaSettings的实例
53 void CheckCarlaSettings(UWorld *world);
54
55 ///执行引擎命令,将低质量水平应用于世界
56 void LaunchLowQualityCommands(UWorld *world) const;
57
58 void SetAllRoads(
59 UWorld *world,
60 float max_draw_distance,
61 const TArray<FStaticMaterial> &road_pieces_materials) const;
62
63 void SetActorComponentsDrawDistance(AActor *actor, float max_draw_distance) const;
64
65 void SetPostProcessEffectsEnabled(UWorld *world, bool enabled) const;
66
67 ///执行引擎命令,将史诗般的质量水平应用于世界
68 void LaunchEpicQualityCommands(UWorld *world) const;
69
70 void SetAllLights(
71 UWorld *world,
72 float max_distance_fade,
73 bool cast_shadows,
74 bool hide_non_directional) const;
75
76private:
77
78 /// 重新启动级别后当前应用的质量级别
80
81 UCarlaSettings *CarlaSettings = nullptr;
82
83 FOnActorSpawned::FDelegate ActorSpawnedDelegate;
84};
TSharedPtr< const FActorInfo > carla::rpc::ActorState UWorld * World
TSharedPtr< const FActorInfo > carla::rpc::ActorState UWorld Actor
EQualityLevel
用于为生成到世界中的每个角色设置设置
FOnActorSpawned::FDelegate ActorSpawnedDelegate
static EQualityLevel AppliedLowPostResetQualityLevel
重新启动级别后当前应用的质量级别
Carla 的全局设置