CARLA
Loading...
Searching...
No Matches
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
11class UWorld;
12class AActor;
13class UPrimitiveComponent;
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.
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.
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.
38 UWorld* World,
39 ATrafficSignBase* Sign,
40 const TArray<AActor*>& IgnoredActors,
41 const TArray<UPrimitiveComponent*>& IgnoredComponents);
42}
Helpers to snap OpenDRIVE-spawned traffic signs / lights onto the ground so they are not left floatin...
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...
bool AdjustLocationToGround(UWorld *World, FVector &Location, const TArray< AActor * > &IgnoredActors, const TArray< UPrimitiveComponent * > &IgnoredComponents)
Line-trace downward to find the ground under Location.