CARLA
Toggle main menu visibility
Loading...
Searching...
No Matches
Unreal
CarlaUnreal
Plugins
Carla
Source
Carla
Traffic
TrafficSignHeightUtils.h
Go to the documentation of this file.
1
// Copyright (c) 2026 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 "CoreMinimal.h"
10
11
class
UWorld;
12
class
AActor
;
13
class
UPrimitiveComponent;
14
class
ATrafficSignBase
;
15
16
/// Helpers to snap OpenDRIVE-spawned traffic signs / lights onto the ground so
17
/// they are not left floating in the air or sunk below the terrain.
18
namespace
TrafficSignHeightUtils
19
{
20
/// Line-trace downward to find the ground under \p Location. Every surface
21
/// along the ray is considered and the first one that is ground wins, so a
22
/// fence or other prop beside the pole is skipped instead of being treated
23
/// as the ground. On hit, set Location.Z to the ground hit plus a small
24
/// offset and return true; otherwise leave Location untouched and return
25
/// false.
26
bool
AdjustLocationToGround
(
27
UWorld* World,
28
FVector& Location,
29
const
TArray<AActor*>& IgnoredActors,
30
const
TArray<UPrimitiveComponent*>& IgnoredComponents);
31
32
/// Snap a single traffic sign to the ground and shift its trigger
33
/// UBoxComponents by the same delta so they stay aligned. Skips invalid
34
/// signs, signs already positioned, and signs that were not generated from
35
/// OpenDRIVE (hand-placed level actors are never moved). Sets
36
/// Sign->bPositioned and returns true on success.
37
bool
AdjustSignToGround
(
38
UWorld* World,
39
ATrafficSignBase* Sign,
40
const
TArray<AActor*>& IgnoredActors,
41
const
TArray<UPrimitiveComponent*>& IgnoredComponents);
42
}
AActor
ATrafficSignBase
Definition
TrafficSignBase.h:105
TrafficSignHeightUtils
Helpers to snap OpenDRIVE-spawned traffic signs / lights onto the ground so they are not left floatin...
Definition
TrafficSignHeightUtils.cpp:24
TrafficSignHeightUtils::AdjustSignToGround
bool AdjustSignToGround(UWorld *World, ATrafficSignBase *Sign, const TArray< AActor * > &IgnoredActors, const TArray< UPrimitiveComponent * > &IgnoredComponents)
Snap a single traffic sign to the ground and shift its trigger UBoxComponents by the same delta so th...
Definition
TrafficSignHeightUtils.cpp:110
TrafficSignHeightUtils::AdjustLocationToGround
bool AdjustLocationToGround(UWorld *World, FVector &Location, const TArray< AActor * > &IgnoredActors, const TArray< UPrimitiveComponent * > &IgnoredComponents)
Line-trace downward to find the ground under Location.
Definition
TrafficSignHeightUtils.cpp:66
Generated by
1.18.0