8#include "CoreMinimal.h"
9#include "GameFramework/Pawn.h"
10#include "Engine/World.h"
21#include "Vehicle.generated.h"
23class UNiagaraComponent;
24class USensorsManagerComponent;
51 UFUNCTION(BlueprintCallable)
61 UFUNCTION(BlueprintImplementableEvent, BlueprintCallable)
62 void TogglePhysics(
bool isOn);
70 UFUNCTION(BlueprintNativeEvent, BlueprintCallable)
71 void TeleportVehicleTo(FVector NewLocation, FRotator NewRotation);
78 virtual
void TeleportVehicleTo_Implementation(FVector NewLocation, FRotator NewRotation);
83 UFUNCTION(BlueprintImplementableEvent, BlueprintCallable)
90 UFUNCTION(BlueprintImplementableEvent, BlueprintCallable)
91 void ToggleLights(
bool isOn);
97 UFUNCTION(BlueprintCallable)
98 void SetVisualizeVehicleOverlapArea(
bool Visible);
105 UFUNCTION(BlueprintCallable)
112 UFUNCTION(BlueprintCallable)
113 void SetVehicleIsInGarage(
bool VehicleIsInGarage)
115 VehicleInGarage = VehicleIsInGarage;
116 OnVehicleGarageChanged.Broadcast(VehicleInGarage);
123 UFUNCTION(BlueprintPure)
124 bool IsVehicleInGarage()
const
126 return VehicleInGarage;
133 UFUNCTION(BlueprintCallable)
134 USensorsManagerComponent* GetSensorsManager()
const
136 return SensorsManager;
143 UFUNCTION(BlueprintPure)
146 return CollisionSensor;
153 UFUNCTION(BlueprintPure)
156 return TransformSensor;
163 UFUNCTION(BlueprintPure)
166 return OverlapSensor;
173 UFUNCTION(BlueprintPure)
174 FTransform GetMovedFromGarageTransform()
const
176 return MovedFromGarageTransform;
179 UFUNCTION(BlueprintCallable)
180 virtual
void SetCurrentTransformToMovedFromGarageTransform()
182 MovedFromGarageTransform = GetTransform();
187 return InteractableName;
192 return GetActorTransform();
208 const FString ID = IActorInformation::Execute_GetActorID(
this);
209 const FString Name = IActorInformation::Execute_GetActorName(
this);
210 const FTransform VehicleTransform = GetActorTransform();
211 const FVector Location = VehicleTransform.GetLocation();
212 const FRotator Rotation = VehicleTransform.Rotator();
213 FString Information = FString::Printf(TEXT(
"Vehicle: %s, Name: %s, ID: %s, Location: %s, Rotation: %s"), *
Vehicle, *Name, *ID, *Location.ToString(), *Rotation.ToString());
220 ActorName = NewActorName;
225 ActorName = NewActorName;
233 UFUNCTION(BlueprintCallable)
236 VehicleParameters = NewParameters;
237 ApplyVehicleParameters(VehicleParameters);
243 UFUNCTION(BlueprintPure)
246 return VehicleParameters;
252 UFUNCTION(BlueprintImplementableEvent, BlueprintCallable)
255 virtual
void PossessedBy(AController* NewController) override;
257 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Interactable")
258 FText InteractableName;
260 UPROPERTY(BlueprintAssignable)
261 FVehicleGarageChangedDelegate OnVehicleGarageChanged;
267 virtual
void EndPlay(const EEndPlayReason::Type EndPlayReason) override;
275 UPROPERTY(Category =
Vehicle, VisibleAnywhere, BlueprintReadWrite)
281 UPROPERTY(Category =
Vehicle, VisibleAnywhere, BlueprintReadOnly)
282 TObjectPtr<USensorsManagerComponent> SensorsManager;
284 UPROPERTY(VisibleAnywhere, BlueprintReadOnly)
287 UPROPERTY(VisibleAnywhere, BlueprintReadOnly)
290 UPROPERTY(VisibleAnywhere, BlueprintReadOnly)
293 UPROPERTY(VisibleAnywhere, BlueprintReadWrite)
294 UNiagaraComponent* NiagaraComponent =
nullptr;
296 UPROPERTY(VisibleAnywhere)
299 UPROPERTY(VisibleAnywhere)
302 UPROPERTY(EditAnywhere, BlueprintReadWrite)
303 FTransform OriginalCameraTransform;
305 FTransform MovedFromGarageTransform;
307 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)