UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
TAnimatedAttribute< NumericType > Class Template Reference

#include <AnimatedAttribute.h>

+ Inheritance diagram for TAnimatedAttribute< NumericType >:

Classes

struct  FPrivateToken
 

Public Types

using FGetter = TDelegate< NumericType()>
 

Public Member Functions

template<typename InterpolatorSettings >
 TAnimatedAttribute (FPrivateToken, const InterpolatorSettings &InSettings)
 
template<typename OtherType >
void Set (const OtherType &InNewValue)
 
void Set (NumericType &&InNewValue)
 
void SetValueAndStop (const NumericType &InNewValue)
 
void SetValueAndStop (NumericType &&InNewValue)
 
bool IsSet () const
 
const NumericType & Get () const
 
const NumericType & Get (const NumericType &DefaultValue) const
 
const NumericType & GetDesiredValue () const
 
double GetOverAllDeltaTime () const
 
TOptional< NumericType > GetDelay () const
 
void SetDelayOneShot (double InDelay)
 
void SetTolerance (double Tolerance)
 
bool IsPlaying () const
 
void EnableInterpolation (bool bEnabled=true)
 
void DisableInterpolation ()
 
bool IsBound () const
 
bool IdenticalTo (const TAnimatedAttribute &InOther) const
 
TAttributeInterpolator< NumericType >::FInterpolatorEventOnInterpolationStarted ()
 
TAttributeInterpolator< NumericType >::FInterpolatorEventOnInterpolationStopped ()
 
- Public Member Functions inherited from TSharedFromThis< TAnimatedAttributeBase >
TSharedRef< TAnimatedAttributeBase, Mode > AsShared ()
 
TSharedRef< TAnimatedAttributeBase const, Mode > AsShared () const
 
TSharedRef< SubobjectType, Mode > AsSharedSubobject (SubobjectType *SubobjectPtr) const
 
TWeakPtr< TAnimatedAttributeBase, Mode > AsWeak ()
 
TWeakPtr< TAnimatedAttributeBase const, Mode > AsWeak () const
 
TWeakPtr< SubobjectType, Mode > AsWeakSubobject (SubobjectType *SubobjectPtr) const
 
void UpdateWeakReferenceInternal (TSharedPtr< SharedPtrType, SharedPtrMode > const *InSharedPtr, OtherType *InObject) const
 
void UpdateWeakReferenceInternal (TSharedRef< SharedRefType, SharedPtrMode > const *InSharedRef, OtherType *InObject) const
 
UE_FORCEINLINE_HINT bool DoesSharedInstanceExist () const
 

Static Public Member Functions

template<typename InterpolatorSettings , typename OtherType >
static TSharedRef< TAnimatedAttributeCreate (const InterpolatorSettings &InSettings, OtherType &&InInitialValue)
 
template<typename InterpolatorSettings >
static TSharedRef< TAnimatedAttributeCreateWithGetter (const InterpolatorSettings &InSettings, const FGetter &InGetter, const TOptional< NumericType > &InDefaultValue=TOptional< NumericType >())
 
template<typename InterpolatorSettings >
static TSharedRef< TAnimatedAttributeCreateWithGetter (const InterpolatorSettings &InSettings, FGetter &&InGetter, const TOptional< NumericType > &InDefaultValue=TOptional< NumericType >())
 

Protected Member Functions

 TAnimatedAttribute ()=delete
 
- Protected Member Functions inherited from TAnimatedAttributeBase
SLATE_API TAnimatedAttributeBase ()
 
virtual SLATE_API ~TAnimatedAttributeBase ()
 
SLATE_API void Register ()
 
SLATE_API void Unregister ()
 
- Protected Member Functions inherited from TSharedFromThis< TAnimatedAttributeBase >
 TSharedFromThis ()
 
 TSharedFromThis (TSharedFromThis const &)
 
UE_FORCEINLINE_HINT TSharedFromThisoperator= (TSharedFromThis const &)
 
 ~TSharedFromThis ()
 

Friends

template<class OtherType >
class TAnimatedAttribute
 

Additional Inherited Members

- Static Protected Member Functions inherited from TSharedFromThis< TAnimatedAttributeBase >
static UE_FORCEINLINE_HINT TSharedRef< OtherType, Mode > SharedThis (OtherType *ThisPtr)
 
static UE_FORCEINLINE_HINT TSharedRef< OtherType const, Mode > SharedThis (const OtherType *ThisPtr)
 

Detailed Description

template<typename NumericType>
class TAnimatedAttribute< NumericType >

Animated Attribute object

Member Typedef Documentation

◆ FGetter

template<typename NumericType >
using TAnimatedAttribute< NumericType >::FGetter = TDelegate<NumericType()>

Attribute 'getter' delegate

NumericType GetValue() const

Returns
The attribute's value

Constructor & Destructor Documentation

◆ TAnimatedAttribute() [1/2]

template<typename NumericType >
TAnimatedAttribute< NumericType >::TAnimatedAttribute ( )
protecteddelete

Default constructor.

◆ TAnimatedAttribute() [2/2]

template<typename NumericType >
TAnimatedAttribute< NumericType >::TAnimatedAttribute ( FPrivateToken  ,
const InterpolatorSettings InSettings 
)
inline

Construct only from interpolator settings This is used only for the Create methods and only accessible from there due to the use of a protected FPrivateToken. Please rely on the Create methods if you are seeing a compiler error related to this.

Parameters
InSettingsThe settings for the interpolator

Member Function Documentation

◆ Create()

template<typename NumericType >
static TSharedRef< TAnimatedAttribute > TAnimatedAttribute< NumericType >::Create ( const InterpolatorSettings InSettings,
OtherType &&  InInitialValue 
)
inlinestatic

Static: Creates an animated attribute implicitly from an initial value

Parameters
InSettingsThe settings for the interpolator
InInitialValueThe value for this attribute

◆ CreateWithGetter() [1/2]

template<typename NumericType >
static TSharedRef< TAnimatedAttribute > TAnimatedAttribute< NumericType >::CreateWithGetter ( const InterpolatorSettings InSettings,
const FGetter InGetter,
const TOptional< NumericType > &  InDefaultValue = TOptional<NumericType>() 
)
inlinestatic

Static: Creates an animated attribute that's pre-bound to the specified 'getter' delegate

Parameters
InSettingsThe settings for the interpolator
InGetterDelegate to bind
InDefaultValueThe optional default value. If not specified the getter will be used to determine the default

◆ CreateWithGetter() [2/2]

template<typename NumericType >
static TSharedRef< TAnimatedAttribute > TAnimatedAttribute< NumericType >::CreateWithGetter ( const InterpolatorSettings InSettings,
FGetter &&  InGetter,
const TOptional< NumericType > &  InDefaultValue = TOptional<NumericType>() 
)
inlinestatic

Static: Creates an animated attribute that's pre-bound to the specified 'getter' delegate

Parameters
InSettingsThe settings for the interpolator
InGetterDelegate to bind
InDefaultValueThe optional default value. If not specified the getter will be used to determine the default

◆ DisableInterpolation()

template<typename NumericType >
void TAnimatedAttribute< NumericType >::DisableInterpolation ( )
inline

Disables the interpolator and returns values in immediate mode

◆ EnableInterpolation()

template<typename NumericType >
void TAnimatedAttribute< NumericType >::EnableInterpolation ( bool  bEnabled = true)
inline

Enables (or disables) the interpolator and returns values in interpolated or immediate mode

◆ Get() [1/2]

template<typename NumericType >
const NumericType & TAnimatedAttribute< NumericType >::Get ( ) const
inline

Gets the attribute's current value. Assumes that the attribute is set.

Returns
The attribute's value

◆ Get() [2/2]

template<typename NumericType >
const NumericType & TAnimatedAttribute< NumericType >::Get ( const NumericType &  DefaultValue) const
inline

Gets the attribute's current value. The attribute may not be set, in which case use the default value provided. Shorthand for the boilerplate code: MyAttribute.IsSet() ? MyAttribute.Get() : DefaultValue

◆ GetDelay()

template<typename NumericType >
TOptional< NumericType > TAnimatedAttribute< NumericType >::GetDelay ( ) const
inline

Returns the currently set delay on the interpolator

◆ GetDesiredValue()

template<typename NumericType >
const NumericType & TAnimatedAttribute< NumericType >::GetDesiredValue ( ) const
inline

Returns the desired value this attribute is trying to reach.

◆ GetOverAllDeltaTime()

template<typename NumericType >
double TAnimatedAttribute< NumericType >::GetOverAllDeltaTime ( ) const
inline

Returns the overall deltatime of the interpolator

◆ IdenticalTo()

template<typename NumericType >
bool TAnimatedAttribute< NumericType >::IdenticalTo ( const TAnimatedAttribute< NumericType > &  InOther) const
inline

Is this attribute identical to another TAnimationAttribute.

Parameters
InOtherThe other attribute to compare with.
Returns
true if the attributes are identical, false otherwise.

◆ IsBound()

template<typename NumericType >
bool TAnimatedAttribute< NumericType >::IsBound ( ) const
inline

Checks to see if this attribute has a 'getter' function bound

Returns
True if attribute is bound to a getter function

◆ IsPlaying()

template<typename NumericType >
bool TAnimatedAttribute< NumericType >::IsPlaying ( ) const
inline

Returns true if the attribute is currently animating

◆ IsSet()

template<typename NumericType >
bool TAnimatedAttribute< NumericType >::IsSet ( ) const
inline

Was this TAnimatedAttribute ever assigned?

◆ OnInterpolationStarted()

template<typename NumericType >
TAttributeInterpolator< NumericType >::FInterpolatorEvent & TAnimatedAttribute< NumericType >::OnInterpolationStarted ( )
inline

◆ OnInterpolationStopped()

template<typename NumericType >
TAttributeInterpolator< NumericType >::FInterpolatorEvent & TAnimatedAttribute< NumericType >::OnInterpolationStopped ( )
inline

◆ Set() [1/2]

template<typename NumericType >
template<typename OtherType >
void TAnimatedAttribute< NumericType >::Set ( const OtherType InNewValue)
inline

Sets the attribute's value while keeping a running interpolation going. The value will be become the new desired value and the interpolation will continue trying to reach it. If the interpolation is currently stopped the animation / interpolation will restart towards the new provided value.

Parameters
InNewValueThe value to set the attribute to

◆ Set() [2/2]

template<typename NumericType >
void TAnimatedAttribute< NumericType >::Set ( NumericType &&  InNewValue)
inline

Sets the attribute's value while keeping a running interpolation going. The value will be become the new desired value and the interpolation will continue trying to reach it. If the interpolation is currently stopped the animation / interpolation will restart towards the new provided value.

Parameters
InNewValueThe value to set the attribute to

◆ SetDelayOneShot()

template<typename NumericType >
void TAnimatedAttribute< NumericType >::SetDelayOneShot ( double  InDelay)
inline

Sets the attribute's delay as a one shot

◆ SetTolerance()

template<typename NumericType >
void TAnimatedAttribute< NumericType >::SetTolerance ( double  Tolerance)
inline

Sets the tolerance of this interpolator

◆ SetValueAndStop() [1/2]

template<typename NumericType >
void TAnimatedAttribute< NumericType >::SetValueAndStop ( const NumericType &  InNewValue)
inline

Sets the attribute's value and disables animation. The interpolator will be stopped and the value will become the new current value.

Parameters
InNewValueThe value to set the attribute to

◆ SetValueAndStop() [2/2]

template<typename NumericType >
void TAnimatedAttribute< NumericType >::SetValueAndStop ( NumericType &&  InNewValue)
inline

Sets the attribute's value and disables animation. The interpolator will be stopped and the value will become the new current value.

Parameters
InNewValueThe value to set the attribute to

Friends And Related Symbol Documentation

◆ TAnimatedAttribute

template<typename NumericType >
template<class OtherType >
friend class TAnimatedAttribute
friend

The documentation for this class was generated from the following file: