5#include "CoreMinimal.h"
6#include "GameFramework/Actor.h"
7#include "Pickup.generated.h"
9class UProjectileMovementComponent;
10class USphereComponent;
11class UStaticMeshComponent;
21 virtual void BeginPlay()
override;
24 void SetPickupInfo(int32 InPickupID, FVector InExpectedTargetLocation) {PickupID = InPickupID; ExpectedTargetLocation = InExpectedTargetLocation; }
27 void OnComponentBeginOverlap(UPrimitiveComponent* OverlappedComponent, AActor* OtherActor, UPrimitiveComponent* OtherComp, int32 OtherBodyIndex,
bool bFromSweep, const FHitResult& SweepResult);
28 UFUNCTION(BlueprintImplementableEvent, BlueprintCallable)
29 void OnItemPickedUp(AActor* OtherActor);
30 UFUNCTION(BlueprintNativeEvent, BlueprintCallable)
33 float GetMaxPickupDistance()
const {
return MaxPickupDistance; }
37 virtual void Tick(
float DeltaTime)
override;
40 UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category =
"Pickup")
41 float MaxPickupDistance = 500.0f;
43 UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category = "Pickup")
44 float SpawnTorqueIntensity = 500.0f;
46 UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category = "Pickup|
Movement")
47 int MaxNumberOfCorrections = 6;
49 UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category = "Pickup|
Movement")
50 int MaxAllowedTimeToReachPickupRadius = 4;
52 UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category = "Pickup|
Movement")
53 float HelpingForceIntensity = 500.0f;
55 UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category = "Pickup|
Movement")
56 float OutOfBoundsCorrectionIntensity = 500.0f;
58 UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category = "Pickup|
Movement")
59 float OutOfBoundsRandomRotationIntensity = 500.0f;
61 UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category = "Pickup|
Movement")
62 float InterpToRadiusSpeed = 2.f;
64 UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category = "Pickup|
Movement")
65 int MinDistanceFromTargetToStopFinalCorrection = 100;
67 UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category = "Pickup|
Movement")
68 FVector2D SettleForcesCheck = FVector2D(5.f, 2.f);
72 UPROPERTY(EditDefaultsOnly, Category = Pickup)
73 USphereComponent* OverlapComponent =
nullptr;
75 UPROPERTY(EditDefaultsOnly, Category = Pickup)
76 UStaticMeshComponent* StaticMeshComponent =
nullptr;
79 void OnWaitingToReachRadiusExpired();
83 FVector ExpectedTargetLocation = FVector::ZeroVector;
84 FTimerHandle PhysicsTimerHandle;
85 FTimerHandle WaitingToReachRadiusTimerHandle;
86 int CurrentNumberOfCorrections = 0;
88 FVector PreviousLocation = FVector::ZeroVector;
89 FRotator PreviousRotation = FRotator::ZeroRotator;
92 bool bHasReachedPickupRadius = false;
94 bool bIsUnderFinalCorrection = false;
96 bool bIsInterpolatingToRadius = false;
void SetPickupInfo(int32 InPickupID, FVector InExpectedTargetLocation)
Definition: Pickup.h:24
int32 GetPickupID() const
Definition: Pickup.h:23
Definition: ProjectXCharacter.h:128