24 if (
String ==
"Building")
return crp::CityObjectLabel::Buildings;
25 else if (
String ==
"Fence")
return crp::CityObjectLabel::Fences;
26 else if (
String ==
"Pedestrian")
return crp::CityObjectLabel::Pedestrians;
27 else if (
String ==
"Pole")
return crp::CityObjectLabel::Poles;
28 else if (
String ==
"Other")
return crp::CityObjectLabel::Other;
29 else if (
String ==
"Road")
return crp::CityObjectLabel::Roads;
30 else if (
String ==
"RoadLine")
return crp::CityObjectLabel::RoadLines;
31 else if (
String ==
"SideWalk")
return crp::CityObjectLabel::Sidewalks;
32 else if (
String ==
"TrafficSign")
return crp::CityObjectLabel::TrafficSigns;
33 else if (
String ==
"Vegetation")
return crp::CityObjectLabel::Vegetation;
34 else if (
String ==
"Car")
return crp::CityObjectLabel::Car;
35 else if (
String ==
"Wall")
return crp::CityObjectLabel::Walls;
36 else if (
String ==
"Sky")
return crp::CityObjectLabel::Sky;
37 else if (
String ==
"Ground")
return crp::CityObjectLabel::Ground;
38 else if (
String ==
"Bridge")
return crp::CityObjectLabel::Bridge;
39 else if (
String ==
"RailTrack")
return crp::CityObjectLabel::RailTrack;
40 else if (
String ==
"GuardRail")
return crp::CityObjectLabel::GuardRail;
41 else if (
String ==
"TrafficLight")
return crp::CityObjectLabel::TrafficLight;
42 else if (
String ==
"Static")
return crp::CityObjectLabel::Static;
43 else if (
String ==
"Dynamic")
return crp::CityObjectLabel::Dynamic;
44 else if (
String ==
"Water")
return crp::CityObjectLabel::Water;
45 else if (
String ==
"Terrain")
return crp::CityObjectLabel::Terrain;
46 else if (
String ==
"Truck")
return crp::CityObjectLabel::Truck;
47 else if (
String ==
"Motorcycle")
return crp::CityObjectLabel::Motorcycle;
48 else if (
String ==
"Bicycle")
return crp::CityObjectLabel::Bicycle;
49 else if (
String ==
"Bus")
return crp::CityObjectLabel::Bus;
50 else if (
String ==
"Rider")
return crp::CityObjectLabel::Rider;
51 else if (
String ==
"Train")
return crp::CityObjectLabel::Train;
52 else return crp::CityObjectLabel::None;
67 return (Label == crp::CityObjectLabel::Pedestrians ||
68 Label == crp::CityObjectLabel::TrafficSigns ||
69 Label == crp::CityObjectLabel::Car ||
70 Label == crp::CityObjectLabel::Train ||
71 Label == crp::CityObjectLabel::Bicycle ||
72 Label == crp::CityObjectLabel::Motorcycle ||
73 Label == crp::CityObjectLabel::Bus ||
74 Label == crp::CityObjectLabel::Rider ||
75 Label == crp::CityObjectLabel::Truck ||
76 Label == crp::CityObjectLabel::TrafficLight);
108#ifdef CARLA_TAGGER_EXTRA_LOG
109 UE_LOG(LogCarla, Log, TEXT(
"Actor: %s"), *
Actor.GetName());
114 TArray<UStaticMeshComponent *> StaticMeshComponents;
115 Actor.GetComponents<UStaticMeshComponent>(StaticMeshComponents);
116 for (UStaticMeshComponent *Component : StaticMeshComponents) {
118 if (Label == crp::CityObjectLabel::Pedestrians &&
119 Cast<ACarlaWheeledVehicle>(&
Actor))
121 Label = crp::CityObjectLabel::Rider;
125#ifdef CARLA_TAGGER_EXTRA_LOG
126 UE_LOG(LogCarla, Log, TEXT(
" + StaticMeshComponent: %s"), *Component->GetName());
130 if(!Component->IsVisible() || !Component->GetStaticMesh())
139 TArray<USceneComponent *> AttachedComponents = Component->GetAttachChildren();
140 for (USceneComponent *SceneComponent : AttachedComponents) {
141 UTaggedComponent *TaggedSceneComponent = Cast<UTaggedComponent>(SceneComponent);
142 if (
IsValid(TaggedSceneComponent)) {
143 TaggedComponent = TaggedSceneComponent;
144#ifdef CARLA_TAGGER_EXTRA_LOG
145 UE_LOG(LogCarla, Log, TEXT(
" - Found Tag"));
152 if (!TaggedComponent) {
153 TaggedComponent = NewObject<UTaggedComponent>(Component);
154 TaggedComponent->SetupAttachment(Component);
155 TaggedComponent->RegisterComponent();
156#ifdef CARLA_TAGGER_EXTRA_LOG
157 UE_LOG(LogCarla, Log, TEXT(
" - Added Tag"));
163#ifdef CARLA_TAGGER_EXTRA_LOG
164 UE_LOG(LogCarla, Log, TEXT(
" - Color: %s"), *Color.ToString());
168 TaggedComponent->MarkRenderStateDirty();
172 TArray<USkeletalMeshComponent *> SkeletalMeshComponents;
173 Actor.GetComponents<USkeletalMeshComponent>(SkeletalMeshComponents);
174 for (USkeletalMeshComponent *Component : SkeletalMeshComponents) {
176 if (Label == crp::CityObjectLabel::Pedestrians &&
177 Cast<ACarlaWheeledVehicle>(&
Actor))
179 Label = crp::CityObjectLabel::Rider;
182#ifdef CARLA_TAGGER_EXTRA_LOG
183 UE_LOG(LogCarla, Log, TEXT(
" + SkeletalMeshComponent: %s"), *Component->GetName());
187 if(!Component->IsVisible() || !Component->GetSkeletalMeshRenderData())
194 TArray<USceneComponent *> AttachedComponents = Component->GetAttachChildren();
195 for (USceneComponent *SceneComponent : AttachedComponents) {
196 UTaggedComponent *TaggedSceneComponent = Cast<UTaggedComponent>(SceneComponent);
197 if (
IsValid(TaggedSceneComponent)) {
198 TaggedComponent = TaggedSceneComponent;
199#ifdef CARLA_TAGGER_EXTRA_LOG
200 UE_LOG(LogCarla, Log, TEXT(
" - Found Tag"));
207 if (!TaggedComponent) {
208 TaggedComponent = NewObject<UTaggedComponent>(Component);
209 TaggedComponent->SetupAttachment(Component);
210 TaggedComponent->RegisterComponent();
211#ifdef CARLA_TAGGER_EXTRA_LOG
212 UE_LOG(LogCarla, Log, TEXT(
" - Added Tag"));
218#ifdef CARLA_TAGGER_EXTRA_LOG
219 UE_LOG(LogCarla, Log, TEXT(
" - Color: %s"), *Color.ToString());
223 TaggedComponent->MarkRenderStateDirty();
224 TaggedComponent->SetComponentTickEnabled(
true);
UE_LOG(LogCarla, Log, TEXT("UActorDispatcher::Destroying actor: '%s' %x"), *Id, Actor)