2022-05-23 18:41:30 +00:00
|
|
|
// Copyright Epic Games, Inc. All Rights Reserved.
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "Abilities/Tasks/AbilityTask.h"
|
2022-09-13 07:18:28 +00:00
|
|
|
#include "Containers/Array.h"
|
|
|
|
#include "Delegates/Delegate.h"
|
2022-05-23 18:41:30 +00:00
|
|
|
#include "Engine/CollisionProfile.h"
|
|
|
|
#include "Interaction/InteractionOption.h"
|
2022-09-13 07:18:28 +00:00
|
|
|
#include "Math/MathFwd.h"
|
|
|
|
#include "UObject/NameTypes.h"
|
|
|
|
#include "UObject/UObjectGlobals.h"
|
|
|
|
|
2022-05-23 18:41:30 +00:00
|
|
|
#include "AbilityTask_WaitForInteractableTargets.generated.h"
|
|
|
|
|
|
|
|
class AActor;
|
2022-09-13 07:18:28 +00:00
|
|
|
class IInteractableTarget;
|
|
|
|
class UObject;
|
|
|
|
class UWorld;
|
|
|
|
struct FCollisionQueryParams;
|
|
|
|
struct FHitResult;
|
|
|
|
struct FInteractionQuery;
|
|
|
|
template <typename InterfaceType> class TScriptInterface;
|
2022-05-23 18:41:30 +00:00
|
|
|
|
|
|
|
DECLARE_DYNAMIC_MULTICAST_DELEGATE_OneParam(FInteractableObjectsChangedEvent, const TArray<FInteractionOption>&, InteractableOptions);
|
|
|
|
|
|
|
|
UCLASS(Abstract)
|
|
|
|
class UAbilityTask_WaitForInteractableTargets : public UAbilityTask
|
|
|
|
{
|
|
|
|
GENERATED_UCLASS_BODY()
|
|
|
|
|
|
|
|
public:
|
|
|
|
UPROPERTY(BlueprintAssignable)
|
|
|
|
FInteractableObjectsChangedEvent InteractableObjectsChanged;
|
|
|
|
|
|
|
|
protected:
|
|
|
|
|
|
|
|
static void LineTrace(FHitResult& OutHitResult, const UWorld* World, const FVector& Start, const FVector& End, FName ProfileName, const FCollisionQueryParams Params);
|
|
|
|
|
|
|
|
void AimWithPlayerController(const AActor* InSourceActor, FCollisionQueryParams Params, const FVector& TraceStart, float MaxRange, FVector& OutTraceEnd, bool bIgnorePitch = false) const;
|
|
|
|
|
|
|
|
static bool ClipCameraRayToAbilityRange(FVector CameraLocation, FVector CameraDirection, FVector AbilityCenter, float AbilityRange, FVector& ClippedPosition);
|
|
|
|
|
|
|
|
void UpdateInteractableOptions(const FInteractionQuery& InteractQuery, const TArray<TScriptInterface<IInteractableTarget>>& InteractableTargets);
|
|
|
|
|
|
|
|
FCollisionProfileName TraceProfile;
|
|
|
|
|
|
|
|
// Does the trace affect the aiming pitch
|
|
|
|
bool bTraceAffectsAimPitch = true;
|
|
|
|
|
|
|
|
TArray<FInteractionOption> CurrentOptions;
|
|
|
|
};
|