Assign a random route to every ACarlaWheeledVehicle entering the trigger volume. More...
#include <RoutePlanner.h>
Public Member Functions | |
void | AddRoute (float probability, const TArray< FVector > &routePoints) |
ARoutePlanner (const FObjectInitializer &ObjectInitializer) | |
void | AssignRandomRoute (AWheeledVehicleAIController &Controller) const |
virtual void | BeginDestroy () override |
void | CleanRoute () |
void | DrawRoutes () |
void | Init () |
void | SetBoxExtent (const FVector &Extent) |
Public Attributes | |
bool | bIsIntersection = false |
TArray< float > | Probabilities |
TArray< USplineComponent * > | Routes |
UBoxComponent * | TriggerVolume |
Protected Member Functions | |
virtual void | BeginPlay () override |
virtual void | EndPlay (EEndPlayReason::Type EndPlayReason) override |
void | OnTriggerBeginOverlap (UPrimitiveComponent *OverlappedComp, AActor *OtherActor, UPrimitiveComponent *OtherComp, int32 OtherBodyIndex, bool bFromSweep, const FHitResult &SweepResult) |
Assign a random route to every ACarlaWheeledVehicle entering the trigger volume.
Routes must be added in editor after placing this actor into the world. Spline tangents are ignored, only locations are taken into account for making the route.
Definition at line 23 of file RoutePlanner.h.
ARoutePlanner::ARoutePlanner | ( | const FObjectInitializer & | ObjectInitializer | ) |
Definition at line 48 of file RoutePlanner.cpp.
References TriggerVolume.
void ARoutePlanner::AddRoute | ( | float | probability, |
const TArray< FVector > & | routePoints | ||
) |
Definition at line 96 of file RoutePlanner.cpp.
References Probabilities, and Routes.
Referenced by AOpenDriveActor::BuildRoutes().
void ARoutePlanner::AssignRandomRoute | ( | AWheeledVehicleAIController & | Controller | ) | const |
Definition at line 123 of file RoutePlanner.cpp.
References AWheeledVehicleAIController::GetRandomEngine(), PickARoute(), Probabilities, Routes, and AWheeledVehicleAIController::SetFixedRoute().
Referenced by OnTriggerBeginOverlap().
|
overridevirtual |
Definition at line 66 of file RoutePlanner.cpp.
References CleanRoute(), Probabilities, and Routes.
|
overrideprotectedvirtual |
Definition at line 174 of file RoutePlanner.cpp.
References Init().
void ARoutePlanner::CleanRoute | ( | ) |
Definition at line 117 of file RoutePlanner.cpp.
References Probabilities, and Routes.
Referenced by BeginDestroy().
void ARoutePlanner::DrawRoutes | ( | ) |
Definition at line 206 of file RoutePlanner.cpp.
References bIsIntersection, and Routes.
|
overrideprotectedvirtual |
Definition at line 180 of file RoutePlanner.cpp.
References OnTriggerBeginOverlap(), and TriggerVolume.
void ARoutePlanner::Init | ( | ) |
Definition at line 150 of file RoutePlanner.cpp.
References IsSplineValid(), OnTriggerBeginOverlap(), Routes, and TriggerVolume.
Referenced by BeginPlay().
|
protected |
Definition at line 191 of file RoutePlanner.cpp.
References AssignRandomRoute(), and GetVehicleController().
Referenced by EndPlay(), and Init().
|
inline |
Definition at line 35 of file RoutePlanner.h.
References TriggerVolume.
Referenced by AOpenDriveActor::BuildRoutes().
bool ARoutePlanner::bIsIntersection = false |
Definition at line 80 of file RoutePlanner.h.
Referenced by AOpenDriveActor::BuildRoutes(), and DrawRoutes().
TArray<float> ARoutePlanner::Probabilities |
Definition at line 77 of file RoutePlanner.h.
Referenced by AddRoute(), AssignRandomRoute(), BeginDestroy(), and CleanRoute().
TArray<USplineComponent *> ARoutePlanner::Routes |
Definition at line 74 of file RoutePlanner.h.
Referenced by AddRoute(), AssignRandomRoute(), BeginDestroy(), CleanRoute(), DrawRoutes(), and Init().
UBoxComponent* ARoutePlanner::TriggerVolume |
Definition at line 71 of file RoutePlanner.h.
Referenced by ARoutePlanner(), EndPlay(), and Init().