9#include "CoreMinimal.h"
11#include "Components/ActorComponent.h"
12#include "UEaseComponent.generated.h"
22 UPROPERTY(EditAnywhere, BlueprintReadWrite)
25 UPROPERTY(EditAnywhere, BlueprintReadWrite)
28 UPROPERTY(EditAnywhere, BlueprintReadWrite)
31 UPROPERTY(EditAnywhere, BlueprintReadWrite)
34 UPROPERTY(EditAnywhere, BlueprintReadWrite)
36 float ElapsedTime = 0.f;
39 float GetAlpha()
const
41 return FMath::Clamp(Duration > 0.f ? ElapsedTime / Duration : 1.f, 0.f, 1.f);
47 ElapsedTime += DeltaTime;
48 float Alpha = FMath::Clamp(Duration > 0.f ? ElapsedTime / Duration : 1.f, 0.f, 1.f);
61 UPROPERTY(EditAnywhere, BlueprintReadWrite)
64 UPROPERTY(EditAnywhere, BlueprintReadWrite)
65 FVector Current = FVector::ZeroVector;
67 UPROPERTY(EditAnywhere, BlueprintReadWrite)
68 FVector Start = FVector::ZeroVector;
70 UPROPERTY(EditAnywhere, BlueprintReadWrite)
71 FVector Target = FVector::ZeroVector;
73 UPROPERTY(EditAnywhere, BlueprintReadWrite)
76 float ElapsedTime = 0.f;
79 float GetAlpha()
const
81 return FMath::Clamp(Duration > 0.f ? ElapsedTime / Duration : 1.f, 0.f, 1.f);
87 ElapsedTime += DeltaTime;
88 float Alpha = FMath::Clamp(Duration > 0.f ? ElapsedTime / Duration : 1.f, 0.f, 1.f);
101 UPROPERTY(EditAnywhere, BlueprintReadWrite)
104 UPROPERTY(EditAnywhere, BlueprintReadWrite)
105 FRotator Current = FRotator::ZeroRotator;
107 UPROPERTY(EditAnywhere, BlueprintReadWrite)
108 FRotator Start = FRotator::ZeroRotator;
110 UPROPERTY(EditAnywhere, BlueprintReadWrite)
111 FRotator Target = FRotator::ZeroRotator;
113 UPROPERTY(EditAnywhere, BlueprintReadWrite)
114 float Duration = 1.f;
116 float ElapsedTime = 0.f;
119 float GetAlpha()
const
121 return FMath::Clamp(Duration > 0.f ? ElapsedTime / Duration : 1.f, 0.f, 1.f);
127 ElapsedTime += DeltaTime;
128 float Alpha = FMath::Clamp(Duration > 0.f ? ElapsedTime / Duration : 1.f, 0.f, 1.f);
137UCLASS( ClassGroup=(CoffeeLibrary), meta=(BlueprintSpawnableComponent, DisplayName=
"EaseComponent") )
138class COFFEELIBRARY_API UEaseComponent : public UActorComponent
146 virtual
void TickComponent(
float DeltaTime, ELevelTick TickType, FActorComponentTickFunction* ThisTickFunction) override;
148 void UpdateTrack(
float DeltaTime);
151 UFUNCTION(BlueprintPure, Category="Track")
152 float GetTrackAlpha(FName TrankName) const;
155 UFUNCTION(BlueprintPure, Category="Track")
156 float GetEaseFloatTrack(FName TrackName);
158 UFUNCTION(BlueprintCallable, Category="Track")
159 void SetEaseFloatTrack(FName TrackName,
EEaseType EaseType,
float Start,
float Target,
float Duration = 1.f);
162 UFUNCTION(BlueprintPure, Category="Track")
163 FVector GetEaseVectorTrack(FName TrackName);
165 UFUNCTION(BlueprintCallable, Category="Track")
166 void SetEaseVectorTrack(FName TrackName,
EEaseType EaseType, FVector Start, FVector Target,
float Duration = 1.f);
169 UFUNCTION(BlueprintPure, Category="Track")
170 FRotator GetEaseRotatorTrack(FName TrackName);
172 UFUNCTION(BlueprintCallable, Category="Track")
173 void SetEaseRotatorTrack(FName TrackName,
EEaseType EaseType, FRotator Start, FRotator Target,
float Duration = 1.f);
단일 float 값을 시간에 따라 Ease 처리하는 트랙 데이터입니다.
void Update(float DeltaTime)
경과 시간을 누적하고 Ease 결과를 갱신한다.
static float Ease(float Alpha, EEaseType Type)
FRotator 값을 시간에 따라 Ease 처리하는 트랙 데이터입니다.
void Update(float DeltaTime)
경과 시간을 누적하고 Ease 결과를 갱신한다.
FVector 값을 시간에 따라 Ease 처리하는 트랙 데이터입니다.
void Update(float DeltaTime)
경과 시간을 누적하고 Ease 결과를 갱신한다.