9#include "GameFramework/Actor.h"
11#include "Components/BoxComponent.h"
12#include "Components/SplineComponent.h"
14#include "RoutePlanner.generated.h"
29 virtual void BeginDestroy()
override;
40 void AddRoute(
float probability,
const TArray<FVector> &routePoints);
49 virtual void PostEditChangeProperty(FPropertyChangedEvent &PropertyChangedEvent)
override;
53 virtual void BeginPlay()
override;
55 virtual void EndPlay(EEndPlayReason::Type EndPlayReason)
override;
58 void OnTriggerBeginOverlap(
64 const FHitResult &SweepResult);
68 UPROPERTY(EditAnywhere)
71 UPROPERTY(BlueprintReadWrite, Category = "Traffic Routes", EditAnywhere)
72 TArray<USplineComponent *> Routes;
74 UPROPERTY(BlueprintReadWrite, Category = "Traffic Routes", EditAnywhere, EditFixedSize)
75 TArray<
float> Probabilities;
77 UPROPERTY(BlueprintReadWrite, Category = "Traffic Routes", EditAnywhere, EditFixedSize)
78 bool bIsIntersection = false;
为每个进入触发体积的 ACarlaWheeledVehicle 分配一条随机路线。 将此参与者放入世界后,必须在编辑器中添加路线。样条线切线将被忽略,仅考虑位置来制定路线。
void SetBoxExtent(const FVector &Extent)