CARLA
载入中...
搜索中...
未找到
Unreal
CarlaUE4
Plugins
Carla
Source
Carla
Game
TaggerDelegate.cpp
浏览该文件的文档.
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
#include "
Carla.h
"
8
#include "
TaggerDelegate.h
"
9
10
#include "
Game/Tagger.h
"
11
12
#include "Engine/World.h"
13
14
UTaggerDelegate::UTaggerDelegate
() :
15
ActorSpawnedDelegate(FOnActorSpawned::FDelegate::CreateUObject(this, &
UTaggerDelegate
::OnActorSpawned)) {}
16
17
void
UTaggerDelegate::RegisterSpawnHandler
(UWorld *InWorld)
18
{
19
InWorld->AddOnActorSpawnedHandler(
ActorSpawnedDelegate
);
20
}
21
22
void
UTaggerDelegate::OnActorSpawned
(
AActor
* InActor)
23
{
24
if
(InActor !=
nullptr
) {
25
ATagger::TagActor
(*InActor,
bSemanticSegmentationEnabled
);
26
}
27
}
Carla.h
TaggerDelegate.h
Tagger.h
AActor
ATagger::TagActor
static void TagActor(const AActor &Actor, bool bTagForSemanticSegmentation)
Set the tag of an actor.
Definition
Tagger.cpp:104
UTaggerDelegate
Used to tag every actor that is spawned into the world.
Definition
TaggerDelegate.h:16
UTaggerDelegate::OnActorSpawned
void OnActorSpawned(AActor *Actor)
Definition
TaggerDelegate.cpp:22
UTaggerDelegate::ActorSpawnedDelegate
FOnActorSpawned::FDelegate ActorSpawnedDelegate
Definition
TaggerDelegate.h:34
UTaggerDelegate::bSemanticSegmentationEnabled
bool bSemanticSegmentationEnabled
Definition
TaggerDelegate.h:36
UTaggerDelegate::UTaggerDelegate
UTaggerDelegate()
Definition
TaggerDelegate.cpp:14
UTaggerDelegate::RegisterSpawnHandler
void RegisterSpawnHandler(UWorld *World)
Definition
TaggerDelegate.cpp:17
制作者
1.10.0