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);
69 UFUNCTION(BlueprintImplementableEvent, BlueprintCallable)
70 void SetVehicleMeshVisibility(
bool Visible);
77 UFUNCTION(BlueprintNativeEvent, BlueprintCallable)
78 void TeleportVehicleTo(FVector NewLocation, FRotator NewRotation);
85 virtual
void TeleportVehicleTo_Implementation(FVector NewLocation, FRotator NewRotation);
90 UFUNCTION(BlueprintImplementableEvent, BlueprintCallable)
97 UFUNCTION(BlueprintImplementableEvent, BlueprintCallable)
98 void ToggleLights(
bool isOn);
104 UFUNCTION(BlueprintCallable)
105 void SetVisualizeVehicleOverlapArea(
bool Visible);
112 UFUNCTION(BlueprintCallable)
119 UFUNCTION(BlueprintCallable)
120 void SetVehicleIsInGarage(
bool VehicleIsInGarage)
122 VehicleInGarage = VehicleIsInGarage;
123 OnVehicleGarageChanged.Broadcast(VehicleInGarage);
130 UFUNCTION(BlueprintPure)
131 bool IsVehicleInGarage()
const
133 return VehicleInGarage;
140 UFUNCTION(BlueprintCallable)
141 USensorsManagerComponent* GetSensorsManager()
const
143 return SensorsManager;
150 UFUNCTION(BlueprintPure)
153 return CollisionSensor;
160 UFUNCTION(BlueprintPure)
163 return TransformSensor;
170 UFUNCTION(BlueprintPure)
173 return OverlapSensor;
180 UFUNCTION(BlueprintPure)
181 FTransform GetMovedFromGarageTransform()
const
183 return MovedFromGarageTransform;
186 UFUNCTION(BlueprintCallable)
187 virtual
void SetCurrentTransformToMovedFromGarageTransform()
189 MovedFromGarageTransform = GetTransform();
194 return InteractableName;
199 return GetActorTransform();
215 const FString ID = IActorInformation::Execute_GetActorID(
this);
216 const FString Name = IActorInformation::Execute_GetActorName(
this);
217 const FTransform VehicleTransform = GetActorTransform();
218 const FVector Location = VehicleTransform.GetLocation();
219 const FRotator Rotation = VehicleTransform.Rotator();
220 FString Information = FString::Printf(TEXT(
"Vehicle: %s, Name: %s, ID: %s, Location: %s, Rotation: %s"), *
Vehicle, *Name, *ID, *Location.ToString(), *Rotation.ToString());
227 ActorName = NewActorName;
232 ActorName = NewActorName;
240 UFUNCTION(BlueprintCallable)
246 UFUNCTION(BlueprintPure)
249 return VehicleParameters;
255 UFUNCTION(BlueprintImplementableEvent, BlueprintCallable)
258 virtual
void PossessedBy(AController* NewController) override;
260 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Interactable")
261 FText InteractableName;
263 UPROPERTY(BlueprintAssignable)
264 FVehicleGarageChangedDelegate OnVehicleGarageChanged;
270 virtual
void EndPlay(const EEndPlayReason::Type EndPlayReason) override;
278 UPROPERTY(Category =
Vehicle, VisibleAnywhere, BlueprintReadWrite)
284 UPROPERTY(Category =
Vehicle, VisibleAnywhere, BlueprintReadOnly)
285 TObjectPtr<USensorsManagerComponent> SensorsManager;
287 UPROPERTY(VisibleAnywhere, BlueprintReadOnly)
290 UPROPERTY(VisibleAnywhere, BlueprintReadOnly)
293 UPROPERTY(VisibleAnywhere, BlueprintReadOnly)
296 UPROPERTY(VisibleAnywhere, BlueprintReadWrite)
297 UNiagaraComponent* NiagaraComponent =
nullptr;
301 UPROPERTY(VisibleAnywhere, BlueprintReadWrite)
302 TArray<UStaticMeshComponent*> ExtraTransformSensorPositions;
304 UPROPERTY(VisibleAnywhere)
307 UPROPERTY(VisibleAnywhere)
310 UPROPERTY(EditAnywhere, BlueprintReadWrite)
311 FTransform OriginalCameraTransform;
313 FTransform MovedFromGarageTransform;
315 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)