5#include "GameFramework/Actor.h"
6#include "Kismet/KismetMathLibrary.h"
7#include "Interpolator.generated.h"
15 GENERATED_USTRUCT_BODY()
19 FInterpolationEntry(UObject* Object, FInterpolationDelegate Event, FInterpolationSignature DynamicEvent, FInterpolationDelegate OnCompleteEvent, FInterpolationSignature OnCompleteDynamicEvent,
float TE,
float TT,
float S,
float E, EEasingFunc::Type Ease, UCurveFloat* C)
20 : DynamicDelegate(DynamicEvent), CompleteDynamicDelegate(OnCompleteDynamicEvent), Delegate(Event), CompleteDelegate(OnCompleteEvent), TimeElapsed(TE), TimeTotal(TT), Start(S), End(E), EaseType(Ease), Curve(C), CallingObject(Object)
32 float TimeElapsed = 0.f;
33 float TimeTotal = 0.f;
34 float DeltaTime = 0.0f;
37 float PercentCompleted = 0.0f;
39 bool bInverted =
false;
40 bool bIsValid =
false;
42 UCurveFloat* Curve =
nullptr;
44 bool bReplicated =
false;
49 static uint32 Counter;
52 UObject* CallingObject =
nullptr;
54 bool bCompleted = false;
65 GENERATED_UCLASS_BODY()
68 virtual void Tick(
float DeltaTime)
override;
69 virtual void BeginPlay()
override;
70 virtual void EndPlay(
const EEndPlayReason::Type EndPlayReason);
78 UFUNCTION(BlueprintCallable, Category =
"Interpolation", meta = (WorldContext =
"WorldContextObject", AutoCreateRefTerm =
"OnCompleteEvent"))
79 static int32 InterpolateOverTimeSimple(UObject* WorldContextObject,
float TimeTotal, EEasingFunc::Type EaseType,
const FInterpolationSignature& Event,
const FInterpolationSignature& OnCompleteEvent);
80 static uint32 InterpolateOverTimeSimple(UObject* WorldContextObject,
float TimeTotal, EEasingFunc::Type EaseType,
const FInterpolationDelegate& Event,
const FInterpolationDelegate& OnCompleteEvent);
81 static uint32 InterpolateOverTimeSimple(UObject* WorldContextObject,
float TimeTotal, EEasingFunc::Type EaseType,
const FInterpolationDelegate& Event);
85 UFUNCTION(BlueprintCallable, Category =
"Interpolation", meta = (WorldContext =
"WorldContextObject", AutoCreateRefTerm =
"OnCompleteEvent"))
86 static int32 InterpolateOverTimeCustomCurve(UObject* WorldContextObject,
float TimeElapsed,
float TimeTotal,
float Start,
float End, UCurveFloat* Curve,
const FInterpolationSignature& Event,
const FInterpolationSignature& OnCompleteEvent);
87 static int32 InterpolateOverTimeCustomCurve(UObject* WorldContextObject,
float TimeElapsed,
float TimeTotal,
float Start,
float End, UCurveFloat* Curve,
const FInterpolationSignature& Event);
88 static int32 InterpolateOverTimeCustomCurve(UObject* WorldContextObject,
float TimeElapsed,
float TimeTotal,
float Start,
float End, UCurveFloat* Curve,
const FInterpolationDelegate& Event);
89 static int32 InterpolateOverTimeCustomCurve(UObject* WorldContextObject,
float TimeElapsed,
float TimeTotal,
float Start,
float End, UCurveFloat* Curve,
const FInterpolationDelegate& Event,
const FInterpolationDelegate& OnCompleteEvent);
93 UFUNCTION(BlueprintCallable, Category =
"Interpolation", meta = (WorldContext =
"WorldContextObject", AutoCreateRefTerm =
"OnCompleteEvent"))
94 static int32 InterpolateOverTime(UObject* WorldContextObject,
float TimeElapsed,
float TimeTotal,
float Start,
float End, EEasingFunc::Type EaseType,
const FInterpolationSignature& Event,
const FInterpolationSignature& OnCompleteEvent);
95 static uint32 InterpolateOverTime(UObject* WorldContextObject,
float TimeElapsed,
float TimeTotal,
float Start,
float End, EEasingFunc::Type EaseType,
const FInterpolationDelegate &Event,
const FInterpolationDelegate& OnCompleteEvent);
96 static uint32 InterpolateOverTime(UObject* WorldContextObject,
float TimeElapsed,
float TimeTotal,
float Start,
float End, EEasingFunc::Type EaseType,
const FInterpolationDelegate &Event);
97 static uint32 InterpolateOverTime(UObject* WorldContextObject,
float TimeElapsed,
float TimeTotal,
float Start,
float End,
const FInterpolationDelegate& Event,
const FInterpolationSignature& DynamicEvent,
const FInterpolationDelegate& OnCompleteEvent,
const FInterpolationSignature& OnCompleteDynamicEvent, EEasingFunc::Type EaseType = EEasingFunc::Linear, UCurveFloat* Curve =
nullptr,
bool bReplicated =
false);
99 static uint32 InterpolateOverTimeReplicated(UObject* WorldContextObject,
float StartTime,
float EndTime,
float Start,
float End, EEasingFunc::Type EaseType,
const FInterpolationDelegate& Event);
105 UFUNCTION(BlueprintCallable, Category =
"Interpolation")
106 static void ClearInterpolation(
const UObject* Caller,
const int32 ID);
109 UFUNCTION(BlueprintPure, Category =
"Interpolation")
110 static
bool IsInterpolationActive(const UObject* Caller, const int32 ID) {
return GetInterpolationEntryByID(Caller, ID) !=
nullptr; };
113 UFUNCTION(BlueprintCallable, Category =
"Interpolation")
114 static
void CompleteInterpolation(const UObject* Caller, const int32 ID);
117 static
FInterpolationEntry* GetInterpolationEntryByID(const UObject* Caller, const uint32 ID);
120 UFUNCTION(BlueprintCallable, Category = "Interpolation")
121 static
void ClearInterpolatorsForObject(const UObject* Object);
124 static
void NotifyLevelTravel();
127 UFUNCTION(BlueprintCallable, Category = "Interpolation")
128 static
void InvertInterpolator(const UObject* Caller, const int32 ID);
131 static
AInterpolator* GetInterpolator(UObject* WorldContextObject);
DECLARE_DELEGATE_OneParam(FInterpolationDelegate, struct FInterpolationEntry &)
DECLARE_DYNAMIC_DELEGATE_OneParam(FInterpolationSignature, float, Value)
Definition: Interpolator.h:64
Definition: ProjectXGameInstance.h:507
Definition: Interpolator.h:14
FInterpolationSignature DynamicDelegate
Definition: Interpolator.h:27
EEasingFunc::Type EaseType
Definition: Interpolator.h:41
FInterpolationDelegate Delegate
Definition: Interpolator.h:29
FInterpolationEntry(UObject *Object, FInterpolationDelegate Event, FInterpolationSignature DynamicEvent, FInterpolationDelegate OnCompleteEvent, FInterpolationSignature OnCompleteDynamicEvent, float TE, float TT, float S, float E, EEasingFunc::Type Ease, UCurveFloat *C)
Definition: Interpolator.h:19
FInterpolationSignature CompleteDynamicDelegate
Definition: Interpolator.h:28
FInterpolationDelegate CompleteDelegate
Definition: Interpolator.h:30