8#include "CoreMinimal.h"
9#include "GameFramework/Pawn.h"
10#include "Engine/World.h"
21#include "Vehicle.generated.h"
23class UNiagaraComponent;
24class USensorsManagerComponent;
53 UFUNCTION(BlueprintCallable)
63 UFUNCTION(BlueprintImplementableEvent, BlueprintCallable)
64 void TogglePhysics(
bool isOn);
71 UFUNCTION(BlueprintImplementableEvent, BlueprintCallable)
72 void SetVehicleMeshVisibility(
bool Visible);
79 UFUNCTION(BlueprintNativeEvent, BlueprintCallable)
80 void TeleportVehicleTo(FVector NewLocation, FRotator NewRotation);
87 virtual
void TeleportVehicleTo_Implementation(FVector NewLocation, FRotator NewRotation);
92 UFUNCTION(BlueprintImplementableEvent, BlueprintCallable)
99 UFUNCTION(BlueprintImplementableEvent, BlueprintCallable)
100 void ToggleLights(
bool isOn);
106 UFUNCTION(BlueprintCallable)
107 void SetVisualizeVehicleOverlapArea(
bool Visible);
114 UFUNCTION(BlueprintCallable)
121 UFUNCTION(BlueprintCallable)
122 void SetVehicleIsInGarage(
bool VehicleIsInGarage)
124 VehicleInGarage = VehicleIsInGarage;
125 OnVehicleGarageChanged.Broadcast(VehicleInGarage);
132 UFUNCTION(BlueprintPure)
133 bool IsVehicleInGarage()
const
135 return VehicleInGarage;
142 UFUNCTION(BlueprintCallable)
143 USensorsManagerComponent* GetSensorsManager()
const
145 return SensorsManager;
152 UFUNCTION(BlueprintPure)
155 return CollisionSensor;
162 UFUNCTION(BlueprintPure)
165 return TransformSensor;
172 UFUNCTION(BlueprintPure)
175 return OverlapSensor;
182 UFUNCTION(BlueprintPure)
183 FTransform GetMovedFromGarageTransform()
const
185 return MovedFromGarageTransform;
188 UFUNCTION(BlueprintCallable)
189 virtual
void SetCurrentTransformToMovedFromGarageTransform()
191 MovedFromGarageTransform = GetTransform();
196 return InteractableName;
201 return GetActorTransform();
217 const FString ID = IActorInformation::Execute_GetActorID(
this);
218 const FString Name = IActorInformation::Execute_GetActorName(
this);
219 const FTransform VehicleTransform = GetActorTransform();
220 const FVector Location = VehicleTransform.GetLocation();
221 const FRotator Rotation = VehicleTransform.Rotator();
222 FString Information = FString::Printf(TEXT(
"Vehicle: %s, Name: %s, ID: %s, Location: %s, Rotation: %s"), *
Vehicle, *Name, *ID, *Location.ToString(), *Rotation.ToString());
229 ActorName = NewActorName;
234 ActorName = NewActorName;
242 UFUNCTION(BlueprintCallable)
248 UFUNCTION(BlueprintPure)
251 return VehicleParameters;
257 UFUNCTION(BlueprintImplementableEvent, BlueprintCallable)
260 virtual
void PossessedBy(AController* NewController) override;
262 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Interactable")
263 FText InteractableName;
265 UPROPERTY(BlueprintAssignable)
266 FVehicleGarageChangedDelegate OnVehicleGarageChanged;
272 virtual
void EndPlay(const EEndPlayReason::Type EndPlayReason) override;
280 UPROPERTY(Category =
Vehicle, VisibleAnywhere, BlueprintReadWrite)
286 UPROPERTY(Category =
Vehicle, VisibleAnywhere, BlueprintReadOnly)
287 TObjectPtr<USensorsManagerComponent> SensorsManager;
289 UPROPERTY(VisibleAnywhere, BlueprintReadOnly)
292 UPROPERTY(VisibleAnywhere, BlueprintReadOnly)
295 UPROPERTY(VisibleAnywhere, BlueprintReadOnly)
298 UPROPERTY(VisibleAnywhere, BlueprintReadWrite)
299 UNiagaraComponent* NiagaraComponent =
nullptr;
303 UPROPERTY(VisibleAnywhere, BlueprintReadWrite)
304 TArray<UStaticMeshComponent*> ExtraTransformSensorPositions;
306 UPROPERTY(VisibleAnywhere)
309 UPROPERTY(VisibleAnywhere)
312 UPROPERTY(EditAnywhere, BlueprintReadWrite)
313 FTransform OriginalCameraTransform;
315 FTransform MovedFromGarageTransform;
317 bool VehicleInGarage = false;
DECLARE_DYNAMIC_MULTICAST_DELEGATE_OneParam(FVehicleGarageChangedDelegate, bool, IsVehicleInGarage)
virtual void EndPlay(const EEndPlayReason::Type EndPlayReason) override
virtual void BeginPlay() override
void ROSBridgeStateChanged(EROSState ROSState)
FString ExportToJsonFile(const FString &FileName)
virtual FText GetInteractableName_Implementation() const override
virtual FString GetActorID_Implementation() const override
virtual void SetActorIDAndName_Implementation(const FString &NewActorName, const FString &NewID) override
virtual FString GetActorInformation_Implementation() const override
virtual FString GetActorName_Implementation() const override
virtual FTransform GetInteractableWorldTransform_Implementation() const override
virtual void SetActorName_Implementation(const FString &NewActorName) override
static FString ConvertVehicleTypeToString(EVehicleTypes VehicleType)