CARLA
Toggle main menu visibility
Loading...
Searching...
No Matches
Unreal
CarlaUnreal
Plugins
Carla
Source
Carla
Util
BoundingBoxCalculator.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 "
Carla/Util/BoundingBox.h
"
10
11
#include "Kismet/BlueprintFunctionLibrary.h"
12
13
#include "GameFramework/Actor.h"
14
15
#include "BoundingBoxCalculator.generated.h"
16
17
UCLASS()
18
class CARLA_API
UBoundingBoxCalculator
: public
UBlueprintFunctionLibrary
19
{
20
GENERATED_BODY()
21
22
public
:
23
24
/// Compute the bounding box of the given Carla actor.
25
///
26
/// @warning If the actor type is not supported a default initialized bounding
27
/// box is returned.
28
///
29
/// @warning Traffic signs return its trigger box instead.
30
UFUNCTION(Category =
"Carla Actor"
, BlueprintCallable)
31
static
FBoundingBox
GetActorBoundingBox
(
32
const
AActor
*Actor,
33
uint8 InTagQueried = 0xFF);
34
35
UFUNCTION(Category =
"Carla Actor"
, BlueprintCallable)
36
static
FBoundingBox
GetVehicleBoundingBox
(
37
const
ACarlaWheeledVehicle
*
Vehicle
,
38
uint8 InTagQueried = 0xFF);
39
40
UFUNCTION(Category =
"Carla Actor"
, BlueprintCallable)
41
static
FBoundingBox
GetCharacterBoundingBox
(
42
const
ACharacter
*
Character
,
43
uint8 InTagQueried = 0xFF);
44
45
UFUNCTION(Category =
"Carla Actor"
, BlueprintCallable)
46
static
void
GetTrafficLightBoundingBox
(
47
const
ATrafficLightBase
*
TrafficLight
,
48
TArray<FBoundingBox>& OutBB,
49
TArray<uint8>& OutTag,
50
uint8 InTagQueried = 0xFF);
51
52
UFUNCTION(Category =
"Carla Util"
, BlueprintCallable)
53
static
FBoundingBox
GetSkeletalMeshBoundingBoxFromComponent
(
const
USkeletalMeshComponent* SkeletalMeshComp);
54
55
UFUNCTION(Category =
"Carla Util"
, BlueprintCallable)
56
static
FBoundingBox
GetSkeletalMeshBoundingBox
(
const
USkeletalMesh* SkeletalMesh);
57
58
UFUNCTION(Category =
"Carla Util"
, BlueprintCallable)
59
static
FBoundingBox
GetStaticMeshBoundingBox
(
const
UStaticMesh* StaticMesh);
60
61
UFUNCTION(Category =
"Carla Util"
, BlueprintCallable)
62
static
void
GetISMBoundingBox
(
63
UInstancedStaticMeshComponent*
ISMComp
,
64
TArray<FBoundingBox>& OutBoundingBox);
65
66
UFUNCTION(Category =
"Carla Util"
, BlueprintCallable)
67
static
void
GetBBsOfStaticMeshComponents
(
68
const
TArray<UStaticMeshComponent*>& StaticMeshComps,
69
TArray<FBoundingBox>& OutBB,
70
TArray<uint8>& OutTag,
71
uint8 InTagQueried = 0xFF);
72
73
UFUNCTION(Category =
"Carla Util"
, BlueprintCallable)
74
static
void
GetBBsOfSkeletalMeshComponents
(
75
const
TArray<USkeletalMeshComponent*>& SkeletalMeshComps,
76
TArray<FBoundingBox>& OutBB,
77
TArray<uint8>& OutTag,
78
uint8 InTagQueried = 0xFF);
79
80
UFUNCTION(Category =
"Carla Util"
, BlueprintCallable)
81
static
TArray<FBoundingBox>
GetBoundingBoxOfActors
(
82
const
TArray<AActor*>& Actors,
83
uint8 InTagQueried = 0xFF);
84
85
UFUNCTION(Category =
"Carla Util"
, BlueprintCallable)
86
static
TArray<FBoundingBox>
GetBBsOfActor
(
87
const
AActor
* Actor,
88
uint8 InTagQueried = 0xFF);
89
90
// Combines the BBs of an actor based on the distance and type of the BB
91
// The BBs not combined are included too (ie: TL BBs and pole)
92
// DistanceThreshold is the maximum distance between BBs to combine, if 0.0 the distance is ignored
93
// TagToCombine defines the type of the BBs to combine, if 0 the type is ignored
94
UFUNCTION(Category =
"Carla Util"
, BlueprintCallable)
95
static
void
CombineBBsOfActor
(
96
const
AActor
* Actor,
97
TArray<FBoundingBox>& OutBB,
98
TArray<uint8>& OutTag,
99
const
float
DistanceThreshold = 0.0f,
100
uint8 TagToCombine = 0xFF);
101
102
UFUNCTION(Category =
"Carla Util"
, BlueprintCallable)
103
static
FBoundingBox
CombineBBs
(
const
TArray<FBoundingBox>& BBsToCombine);
104
105
UFUNCTION(Category =
"Carla Util"
, BlueprintCallable)
106
static
FBoundingBox
CombineBoxes
(
const
TArray<UBoxComponent *>& BBsToCombine);
107
108
// Returns Static Mesh Components that generate the InBB of the Actor
109
// ie: the SMComps that creates the BB of the TL light box
110
UFUNCTION(Category =
"Carla Actor"
, BlueprintCallable)
111
static
void
GetMeshCompsFromActorBoundingBox
(
112
const
AActor
* Actor,
113
const
FBoundingBox
& InBB,
114
TArray<UStaticMeshComponent*>& OutStaticMeshComps);
115
116
};
BoundingBox.h
Character
@ Character
Definition
Unreal/CarlaUnreal/Plugins/Carla/Source/Carla/Util/EnvironmentObject.h:22
TrafficLight
@ TrafficLight
Definition
Unreal/CarlaUnreal/Plugins/Carla/Source/Carla/Util/EnvironmentObject.h:23
Vehicle
@ Vehicle
Definition
Unreal/CarlaUnreal/Plugins/Carla/Source/Carla/Util/EnvironmentObject.h:21
ISMComp
@ ISMComp
Definition
Unreal/CarlaUnreal/Plugins/Carla/Source/Carla/Util/EnvironmentObject.h:24
AActor
ACarlaWheeledVehicle
Base class for CARLA wheeled vehicles.
Definition
CarlaWheeledVehicle.h:85
ACharacter
ATrafficLightBase
Definition
TrafficLightBase.h:21
UBlueprintFunctionLibrary
UBoundingBoxCalculator
Definition
BoundingBoxCalculator.h:19
UBoundingBoxCalculator::GetBBsOfSkeletalMeshComponents
static void GetBBsOfSkeletalMeshComponents(const TArray< USkeletalMeshComponent * > &SkeletalMeshComps, TArray< FBoundingBox > &OutBB, TArray< uint8 > &OutTag, uint8 InTagQueried=0xFF)
Definition
BoundingBoxCalculator.cpp:447
UBoundingBoxCalculator::GetBBsOfActor
static TArray< FBoundingBox > GetBBsOfActor(const AActor *Actor, uint8 InTagQueried=0xFF)
Definition
BoundingBoxCalculator.cpp:494
UBoundingBoxCalculator::GetCharacterBoundingBox
static FBoundingBox GetCharacterBoundingBox(const ACharacter *Character, uint8 InTagQueried=0xFF)
Definition
BoundingBoxCalculator.cpp:241
UBoundingBoxCalculator::GetISMBoundingBox
static void GetISMBoundingBox(UInstancedStaticMeshComponent *ISMComp, TArray< FBoundingBox > &OutBoundingBox)
Definition
BoundingBoxCalculator.cpp:372
UBoundingBoxCalculator::GetSkeletalMeshBoundingBoxFromComponent
static FBoundingBox GetSkeletalMeshBoundingBoxFromComponent(const USkeletalMeshComponent *SkeletalMeshComp)
Definition
BoundingBoxCalculator.cpp:303
UBoundingBoxCalculator::GetSkeletalMeshBoundingBox
static FBoundingBox GetSkeletalMeshBoundingBox(const USkeletalMesh *SkeletalMesh)
Definition
BoundingBoxCalculator.cpp:327
UBoundingBoxCalculator::GetStaticMeshBoundingBox
static FBoundingBox GetStaticMeshBoundingBox(const UStaticMesh *StaticMesh)
Definition
BoundingBoxCalculator.cpp:359
UBoundingBoxCalculator::GetTrafficLightBoundingBox
static void GetTrafficLightBoundingBox(const ATrafficLightBase *TrafficLight, TArray< FBoundingBox > &OutBB, TArray< uint8 > &OutTag, uint8 InTagQueried=0xFF)
Definition
BoundingBoxCalculator.cpp:268
UBoundingBoxCalculator::CombineBBs
static FBoundingBox CombineBBs(const TArray< FBoundingBox > &BBsToCombine)
Definition
BoundingBoxCalculator.cpp:671
UBoundingBoxCalculator::GetBBsOfStaticMeshComponents
static void GetBBsOfStaticMeshComponents(const TArray< UStaticMeshComponent * > &StaticMeshComps, TArray< FBoundingBox > &OutBB, TArray< uint8 > &OutTag, uint8 InTagQueried=0xFF)
Definition
BoundingBoxCalculator.cpp:409
UBoundingBoxCalculator::GetVehicleBoundingBox
static FBoundingBox GetVehicleBoundingBox(const ACarlaWheeledVehicle *Vehicle, uint8 InTagQueried=0xFF)
Definition
BoundingBoxCalculator.cpp:163
UBoundingBoxCalculator::CombineBBsOfActor
static void CombineBBsOfActor(const AActor *Actor, TArray< FBoundingBox > &OutBB, TArray< uint8 > &OutTag, const float DistanceThreshold=0.0f, uint8 TagToCombine=0xFF)
Definition
BoundingBoxCalculator.cpp:570
UBoundingBoxCalculator::GetActorBoundingBox
static FBoundingBox GetActorBoundingBox(const AActor *Actor, uint8 InTagQueried=0xFF)
Compute the bounding box of the given Carla actor.
Definition
BoundingBoxCalculator.cpp:40
UBoundingBoxCalculator::GetMeshCompsFromActorBoundingBox
static void GetMeshCompsFromActorBoundingBox(const AActor *Actor, const FBoundingBox &InBB, TArray< UStaticMeshComponent * > &OutStaticMeshComps)
Definition
BoundingBoxCalculator.cpp:689
UBoundingBoxCalculator::CombineBoxes
static FBoundingBox CombineBoxes(const TArray< UBoxComponent * > &BBsToCombine)
Definition
BoundingBoxCalculator.cpp:676
UBoundingBoxCalculator::GetBoundingBoxOfActors
static TArray< FBoundingBox > GetBoundingBoxOfActors(const TArray< AActor * > &Actors, uint8 InTagQueried=0xFF)
Definition
BoundingBoxCalculator.cpp:480
FBoundingBox
Definition
Unreal/CarlaUnreal/Plugins/Carla/Source/Carla/Util/BoundingBox.h:13
Generated by
1.18.0