12template<
typename NumericType >
43 template<
typename InterpolatorSettings >
57 template<
typename InterpolatorSettings,
typename OtherType >
73 template<
typename InterpolatorSettings >
90 template<
typename InterpolatorSettings >
108 template<
typename OtherType >
112 if(DesiredValue.
IsSet() && !Interpolator->DesiredValue.IsSet())
114 Interpolator->SetValue(DesiredValue.
GetValue());
117 Interpolator->SetValue(DesiredValue.
GetValue());
131 if(DesiredValue.
IsSet() && !Interpolator->DesiredValue.IsSet())
133 Interpolator->SetValue(DesiredValue.
GetValue());
136 Interpolator->SetValue(DesiredValue.
GetValue());
148 Interpolator->
Reset();
160 Interpolator->
Reset();
175 const NumericType&
Get()
const
178 if( Getter.IsBound() )
185 DesiredValue = Getter.Execute();
188 if(DesiredValue.
IsSet())
190 Interpolator->SetValue(DesiredValue.
GetValue());
195 if(Interpolator->IsSet())
197 return Interpolator->
Get();
200 if(DesiredValue.
IsSet())
206 static const NumericType
EmptyResult = NumericType();
214 const NumericType&
Get(
const NumericType& DefaultValue )
const
216 return IsSet() ?
Get() : DefaultValue;
224 if(DesiredValue.
IsSet())
228 static const NumericType
EmptyResult = NumericType();
237 return Interpolator->GetOverAllDeltaTime();
245 return Interpolator->Delay;
253 Interpolator->SetDelayOneShot(
InDelay);
261 Interpolator->SetTolerance(Tolerance);
269 return Interpolator->IsPlaying();
277 Interpolator->SetEnabled(bEnabled);
295 return Getter.IsBound();
306 if(!Interpolator->IdenticalTo(
InOther.Interpolator.Get()))
311 const bool bIsBound =
IsBound();
312 if ( bIsBound ==
InOther.IsBound() )
316 return Getter.GetHandle() ==
InOther.Getter.GetHandle();
329 return Interpolator->OnInterpolationStarted();
337 return Interpolator->OnInterpolationStopped();
347 if( Getter.IsBound() )
349 Interpolator->SetValue(Getter.Execute());
351 if(DesiredValue.
IsSet())
353 Interpolator->SetValue(DesiredValue.
GetValue());
UE_FORCEINLINE_HINT TSharedRef< CastToType, Mode > StaticCastSharedRef(TSharedRef< CastFromType, Mode > const &InSharedRef)
Definition SharedPointer.h:127
UE_FORCEINLINE_HINT TUniquePtr< T > MakeUnique(TArgs &&... Args)
Definition UniquePtr.h:918
UE_INTRINSIC_CAST UE_REWRITE constexpr std::remove_reference_t< T > && MoveTemp(T &&Obj) noexcept
Definition UnrealTemplate.h:520
Definition AnimatedAttributeManager.h:12
Definition AnimatedAttribute.h:14
double GetOverAllDeltaTime() const
Definition AnimatedAttribute.h:235
void SetDelayOneShot(double InDelay)
Definition AnimatedAttribute.h:251
void SetValueAndStop(const NumericType &InNewValue)
Definition AnimatedAttribute.h:145
static TSharedRef< TAnimatedAttribute > Create(const InterpolatorSettings &InSettings, OtherType &&InInitialValue)
Definition AnimatedAttribute.h:58
const NumericType & Get(const NumericType &DefaultValue) const
Definition AnimatedAttribute.h:214
void Set(NumericType &&InNewValue)
Definition AnimatedAttribute.h:128
void EnableInterpolation(bool bEnabled=true)
Definition AnimatedAttribute.h:275
bool IsSet() const
Definition AnimatedAttribute.h:164
void Set(const OtherType &InNewValue)
Definition AnimatedAttribute.h:109
TAttributeInterpolator< NumericType >::FInterpolatorEvent & OnInterpolationStopped()
Definition AnimatedAttribute.h:335
void SetTolerance(double Tolerance)
Definition AnimatedAttribute.h:259
TAttributeInterpolator< NumericType >::FInterpolatorEvent & OnInterpolationStarted()
Definition AnimatedAttribute.h:327
TOptional< NumericType > GetDelay() const
Definition AnimatedAttribute.h:243
void SetValueAndStop(NumericType &&InNewValue)
Definition AnimatedAttribute.h:157
static TSharedRef< TAnimatedAttribute > CreateWithGetter(const InterpolatorSettings &InSettings, FGetter &&InGetter, const TOptional< NumericType > &InDefaultValue=TOptional< NumericType >())
Definition AnimatedAttribute.h:91
bool IsPlaying() const
Definition AnimatedAttribute.h:267
void DisableInterpolation()
Definition AnimatedAttribute.h:283
TAnimatedAttribute(FPrivateToken, const InterpolatorSettings &InSettings)
Definition AnimatedAttribute.h:44
bool IsBound() const
Definition AnimatedAttribute.h:293
const NumericType & Get() const
Definition AnimatedAttribute.h:175
const NumericType & GetDesiredValue() const
Definition AnimatedAttribute.h:222
static TSharedRef< TAnimatedAttribute > CreateWithGetter(const InterpolatorSettings &InSettings, const FGetter &InGetter, const TOptional< NumericType > &InDefaultValue=TOptional< NumericType >())
Definition AnimatedAttribute.h:74
TAnimatedAttribute()=delete
bool IdenticalTo(const TAnimatedAttribute &InOther) const
Definition AnimatedAttribute.h:304
Definition AttributeInterpolator.h:20
Definition SharedPointer.h:153
Definition UniquePtr.h:107
void Reset(T *InPtr=nullptr)
Definition UniquePtr.h:346
UE_FORCEINLINE_HINT T * Get() const
Definition UniquePtr.h:324
Definition AnimatedAttribute.h:28
Definition Optional.h:131
constexpr OptionalType & GetValue()
Definition Optional.h:443
constexpr bool IsSet() const
Definition Optional.h:69