11 : Super(ObjectInitializer)
13 Pole = ObjectInitializer.CreateDefaultSubobject<UStaticMeshComponent>(
this, TEXT(
"Pole"));
14 Pole->SetupAttachment(RootComponent);
15 Pole->SetMobility(EComponentMobility::Static);
16 Pole->SetCollisionProfileName(TEXT(
"BlockAll"));
18 Plate = ObjectInitializer.CreateDefaultSubobject<UStaticMeshComponent>(
this, TEXT(
"Plate"));
19 Plate->SetupAttachment(RootComponent);
20 Plate->SetMobility(EComponentMobility::Static);
21 Plate->SetCollisionProfileName(TEXT(
"NoCollision"));
25 FVector PlateOffset,
float PlateYaw,
float PlateScale)
27 Pole->SetStaticMesh(PoleMesh);
28 Plate->SetStaticMesh(PlateMesh);
29 if (PlateMaterial !=
nullptr)
31 Plate->SetMaterial(0, PlateMaterial);
33 Plate->SetRelativeLocation(PlateOffset);
34 Plate->SetRelativeRotation(FRotator(0.0f, PlateYaw, 0.0f));
35 Plate->SetRelativeScale3D(FVector(PlateScale));
40 if (Type == TEXT(
"206"))
42 return ETrafficSignState::StopSign;
44 if (Type == TEXT(
"205"))
46 return ETrafficSignState::YieldSign;
48 if (Type == TEXT(
"274"))
57 Super::PostInitializeComponents();
68 if (Type == TEXT(
"274"))
ETrafficSignState SpeedLimitStateForKmh(int32 Kmh)
The dedicated state for a km/h value, ETrafficSignState::SpeedLimit when there is none (then store th...
static ETrafficSignState StateForSignal(const FString &Type, const FString &Subtype)
The ETrafficSignState the traffic-light manager matches against for an OpenDRIVE signal type/subtype:...
UStaticMeshComponent * Plate
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 A...
void Setup(UStaticMesh *PoleMesh, UStaticMesh *PlateMesh, UMaterialInterface *PlateMaterial, FVector PlateOffset, float PlateYaw, float PlateScale)
Assign meshes / material and place the plate.
AGeoTrafficSign(const FObjectInitializer &ObjectInitializer)
virtual void PostInitializeComponents() override
Levels baked before every km/h value had a state carry UNKNOWN for e.g.
UStaticMeshComponent * Pole
ETrafficSignState GetTrafficSignState() const
void SetTrafficSignState(ETrafficSignState State)
void SetSpeedLimitKmh(int32 Kmh)
Make this a speed-limit sign for Kmh: picks the dedicated state when one exists, the custom state (va...