CARLA
Loading...
Searching...
No Matches
AGeoTrafficSign Class Reference

A traffic sign baked into a level from the regional sign catalog: a pole and a plate whose material is a constant instance of the atlas selector with the cell baked in. More...

#include <GeoTrafficSign.h>

Inheritance diagram for AGeoTrafficSign:

Public Member Functions

 AGeoTrafficSign (const FObjectInitializer &ObjectInitializer)
void ConfigureForSignal (const FString &Type, const FString &Subtype)
 Set XodrType / XodrSubtype and the matching runtime state (speed limit in km/h from the subtype) so ATrafficLightManager adopts this actor for the signal.
virtual void PostInitializeComponents () override
 Levels baked before every km/h value had a state carry UNKNOWN for e.g.
void Setup (UStaticMesh *PoleMesh, UStaticMesh *PlateMesh, UMaterialInterface *PlateMaterial, FVector PlateOffset, float PlateYaw, float PlateScale)
 Assign meshes / material and place the plate.
Public Member Functions inherited from ATrafficSignBase
 ATrafficSignBase (const FObjectInitializer &ObjectInitializer)
int32 GetSpeedLimitKmh () const
 km/h this sign limits to, -1 when it is not a speed-limit sign.
ETrafficSignState GetTrafficSignState () const
UBoxComponent * GetTriggerVolume () const
TArray< UBoxComponent * > GetTriggerVolumes () const
void SetSpeedLimitKmh (int32 Kmh)
 Make this a speed-limit sign for Kmh: picks the dedicated state when one exists, the custom state (value kept in SpeedLimitKmh) otherwise.
void SetTrafficSignState (ETrafficSignState State)

Static Public Member Functions

static ETrafficSignState StateForSignal (const FString &Type, const FString &Subtype)
 The ETrafficSignState the traffic-light manager matches against for an OpenDRIVE signal type/subtype: stop, yield, or the speed-limit state for the subtype (km/h; ETrafficSignState::SpeedLimit for values without a dedicated state — then also call SetSpeedLimitKmh, or use ConfigureForSignal).

Public Attributes

UStaticMeshComponent * Plate
UStaticMeshComponent * Pole
FString SignalId
 OpenDRIVE signal id this sign was baked for (empty for decorative signs).
FString SignName
 Catalog identifier of the plate (e.g. "max_speed_30").
FString Style
 Regional style ("VC", "MUTCD", "GB").
FString XodrSubtype
FString XodrType
Public Attributes inherited from ATrafficSignBase
bool bGeneratedFromOpenDRIVE = false
 True for signs/lights generated from the OpenDRIVE map.
bool bPositioned = false
 True once this sign has been snapped to the ground, to avoid adjusting it more than once.

Detailed Description

A traffic sign baked into a level from the regional sign catalog: a pole and a plate whose material is a constant instance of the atlas selector with the cell baked in.

Being an ATrafficSignBase, ATrafficLightManager::SpawnSignals adopts it for the OpenDRIVE signal it stands at (within 5 m, TrafficSignState agreeing with the signal type/subtype) and attaches the matching USignComponent, so the map gets the regional look without a duplicate stock blueprint at the same spot.

Definition at line 24 of file GeoTrafficSign.h.

Constructor & Destructor Documentation

◆ AGeoTrafficSign()

AGeoTrafficSign::AGeoTrafficSign ( const FObjectInitializer & ObjectInitializer)

Definition at line 10 of file GeoTrafficSign.cpp.

References Plate, and Pole.

Member Function Documentation

◆ ConfigureForSignal()

void AGeoTrafficSign::ConfigureForSignal ( const FString & Type,
const FString & Subtype )

Set XodrType / XodrSubtype and the matching runtime state (speed limit in km/h from the subtype) so ATrafficLightManager adopts this actor for the signal.

Definition at line 64 of file GeoTrafficSign.cpp.

References ATrafficSignBase::SetSpeedLimitKmh(), ATrafficSignBase::SetTrafficSignState(), StateForSignal(), XodrSubtype, and XodrType.

Referenced by PostInitializeComponents().

◆ PostInitializeComponents()

void AGeoTrafficSign::PostInitializeComponents ( )
overridevirtual

Levels baked before every km/h value had a state carry UNKNOWN for e.g.

10 km/h signs; derive the state from XodrType / XodrSubtype so they are adopted without a rebake.

Definition at line 55 of file GeoTrafficSign.cpp.

References ConfigureForSignal(), ATrafficSignBase::GetTrafficSignState(), UNKNOWN, XodrSubtype, and XodrType.

◆ Setup()

void AGeoTrafficSign::Setup ( UStaticMesh * PoleMesh,
UStaticMesh * PlateMesh,
UMaterialInterface * PlateMaterial,
FVector PlateOffset,
float PlateYaw,
float PlateScale )

Assign meshes / material and place the plate.

PlateOffset is relative to the actor (the pole base), in cm; PlateYaw in degrees turns the plate on the pole.

Definition at line 24 of file GeoTrafficSign.cpp.

References Plate, and Pole.

◆ StateForSignal()

ETrafficSignState AGeoTrafficSign::StateForSignal ( const FString & Type,
const FString & Subtype )
static

The ETrafficSignState the traffic-light manager matches against for an OpenDRIVE signal type/subtype: stop, yield, or the speed-limit state for the subtype (km/h; ETrafficSignState::SpeedLimit for values without a dedicated state — then also call SetSpeedLimitKmh, or use ConfigureForSignal).

UNKNOWN for anything else.

Definition at line 38 of file GeoTrafficSign.cpp.

References SpeedLimitStateForKmh(), and UNKNOWN.

Referenced by ConfigureForSignal().

Member Data Documentation

◆ Plate

UStaticMeshComponent* AGeoTrafficSign::Plate

Definition at line 35 of file GeoTrafficSign.h.

Referenced by AGeoTrafficSign(), and Setup().

◆ Pole

UStaticMeshComponent* AGeoTrafficSign::Pole

Definition at line 32 of file GeoTrafficSign.h.

Referenced by AGeoTrafficSign(), and Setup().

◆ SignalId

FString AGeoTrafficSign::SignalId

OpenDRIVE signal id this sign was baked for (empty for decorative signs).

Definition at line 47 of file GeoTrafficSign.h.

◆ SignName

FString AGeoTrafficSign::SignName

Catalog identifier of the plate (e.g. "max_speed_30").

Definition at line 39 of file GeoTrafficSign.h.

◆ Style

FString AGeoTrafficSign::Style

Regional style ("VC", "MUTCD", "GB").

Definition at line 43 of file GeoTrafficSign.h.

◆ XodrSubtype

FString AGeoTrafficSign::XodrSubtype

Definition at line 53 of file GeoTrafficSign.h.

Referenced by ConfigureForSignal(), and PostInitializeComponents().

◆ XodrType

FString AGeoTrafficSign::XodrType

Definition at line 50 of file GeoTrafficSign.h.

Referenced by ConfigureForSignal(), and PostInitializeComponents().


The documentation for this class was generated from the following files: