UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
FRichCurve Struct Reference

#include <RichCurve.h>

+ Inheritance diagram for FRichCurve:

Public Member Functions

ENGINE_API TArray< FRichCurveKeyGetCopyOfKeys () const
 
ENGINE_API const TArray< FRichCurveKey > & GetConstRefOfKeys () const
 
ENGINE_API TArray< FRichCurveKey >::TConstIterator GetKeyIterator () const
 
ENGINE_API FRichCurveKeyGetKey (FKeyHandle KeyHandle)
 
ENGINE_API FRichCurveKey GetKey (FKeyHandle KeyHandle) const
 
ENGINE_API const FRichCurveKeyGetKeyRef (FKeyHandle KeyHandle) const
 
ENGINE_API FRichCurveKey GetFirstKey () const
 
ENGINE_API FRichCurveKey GetLastKey () const
 
ENGINE_API FRichCurveKeyGetFirstMatchingKey (const TArray< FKeyHandle > &KeyHandles)
 
virtual ENGINE_API FKeyHandle AddKey (float InTime, float InValue, const bool bUnwindRotation=false, FKeyHandle KeyHandle=FKeyHandle()) final override
 
ENGINE_API void ReserveKeys (const int32 Number)
 
ENGINE_API void SetKeys (const TArray< FRichCurveKey > &InKeys)
 
ENGINE_API void DeleteKey (FKeyHandle KeyHandle) final override
 
virtual ENGINE_API FKeyHandle UpdateOrAddKey (float InTime, float InValue, const bool bUnwindRotation=false, float KeyTimeTolerance=UE_KINDA_SMALL_NUMBER) final override
 
virtual ENGINE_API void SetKeyTime (FKeyHandle KeyHandle, float NewTime) final override
 
virtual ENGINE_API float GetKeyTime (FKeyHandle KeyHandle) const final override
 
virtual ENGINE_API void SetKeyValue (FKeyHandle KeyHandle, float NewValue, bool bAutoSetTangents=true) final override
 
virtual ENGINE_API float GetKeyValue (FKeyHandle KeyHandle) const final override
 
virtual ENGINE_API TPair< float, floatGetKeyTimeValuePair (FKeyHandle KeyHandle) const final override
 
ENGINE_API bool IsConstant (float Tolerance=UE_SMALL_NUMBER) const
 
bool IsEmpty () const
 
virtual ENGINE_API void SetKeyInterpMode (FKeyHandle KeyHandle, ERichCurveInterpMode NewInterpMode) final override
 
ENGINE_API void SetKeyInterpMode (FKeyHandle KeyHandle, ERichCurveInterpMode NewInterpMode, bool bAutoSetTangents)
 
ENGINE_API void SetKeyTangentMode (FKeyHandle KeyHandle, ERichCurveTangentMode NewTangentMode, bool bAutoSetTangents=true)
 
ENGINE_API void SetKeyTangentWeightMode (FKeyHandle KeyHandle, ERichCurveTangentWeightMode NewTangentWeightMode, bool bAutoSetTangents=true)
 
virtual ENGINE_API ERichCurveInterpMode GetKeyInterpMode (FKeyHandle KeyHandle) const final override
 
ENGINE_API ERichCurveTangentMode GetKeyTangentMode (FKeyHandle KeyHandle) const
 
virtual ENGINE_API void GetTimeRange (float &MinTime, float &MaxTime) const final override
 
virtual ENGINE_API void GetValueRange (float &MinValue, float &MaxValue) const final override
 
virtual ENGINE_API void Reset () final override
 
virtual ENGINE_API void RemapTimeValue (float &InTime, float &CycleValueOffset) const final override
 
virtual ENGINE_API float Eval (float InTime, float InDefaultValue=0.0f) const final override
 
ENGINE_API void AutoSetTangents (float Tension=0.f)
 
virtual ENGINE_API void ReadjustTimeRange (float NewMinTimeRange, float NewMaxTimeRange, bool bInsert, float OldStartTime, float OldEndTime) final override
 
ENGINE_API bool operator== (const FRichCurve &Curve) const
 
virtual ENGINE_API void BakeCurve (float SampleRate) final override
 
virtual ENGINE_API void BakeCurve (float SampleRate, float FirstKeyTime, float LastKeyTime) final override
 
ENGINE_API void RemoveRedundantAutoTangentKeys (float Tolerance)
 
virtual ENGINE_API void RemoveRedundantKeys (float Tolerance, FFrameRate SampleRate) final override
 
ENGINE_API void RemoveRedundantAutoTangentKeys (float Tolerance, float FirstKeyTime, float LastKeyTime)
 
virtual ENGINE_API void RemoveRedundantKeys (float Tolerance, float FirstKeyTime, float LastKeyTime, FFrameRate SampleRate) final override
 
ENGINE_API void CompressCurve (struct FCompressedRichCurve &OutCurve, float ErrorThreshold=0.0001f, float SampleRate=120.0) const
 
virtual FIndexedCurveDuplicate () const final
 
ENGINE_API void ConvertToChaosCurve (Chaos::FLinearCurve &OutCurve) const
 
virtual int32 GetNumKeys () const final override
 
- Public Member Functions inherited from FRealCurve
 FRealCurve ()
 
bool HasAnyData () const
 
ENGINE_API FKeyHandle FindKey (float KeyTime, float KeyTimeTolerance=UE_KINDA_SMALL_NUMBER) const
 
ENGINE_API bool KeyExistsAtTime (float KeyTime, float KeyTimeTolerance=UE_KINDA_SMALL_NUMBER) const
 
virtual void SetKeyInterpMode(FKeyHandle KeyHandle, ERichCurveInterpMode NewInterpMode) PURE_VIRTUAL(FRealCurve void SetDefaultValue (float InDefaultValue)
 
float GetDefaultValue () const
 
void ClearDefaultValue ()
 
- Public Member Functions inherited from FIndexedCurve
 FIndexedCurve ()
 
virtual ~FIndexedCurve ()
 
ENGINE_API int32 GetIndexSafe (FKeyHandle KeyHandle) const
 
TArray< FKeyHandle >::TConstIterator GetKeyHandleIterator () const
 
ENGINE_API bool IsKeyHandleValid (FKeyHandle KeyHandle) const
 
FKeyHandle GetFirstKeyHandle () const
 
FKeyHandle GetLastKeyHandle () const
 
ENGINE_API FKeyHandle GetNextKey (FKeyHandle KeyHandle) const
 
ENGINE_API FKeyHandle GetPreviousKey (FKeyHandle KeyHandle) const
 
ENGINE_API void ShiftCurve (float DeltaTime)
 
ENGINE_API void ShiftCurve (float DeltaTime, const TSet< FKeyHandle > &KeyHandles)
 
ENGINE_API void ScaleCurve (float ScaleOrigin, float ScaleFactor)
 
ENGINE_API void ScaleCurve (float ScaleOrigin, float ScaleFactor, const TSet< FKeyHandle > &KeyHandles)
 

Public Attributes

TArray< FRichCurveKeyKeys
 
- Public Attributes inherited from FRealCurve
virtual FKeyHandle AddKey (float InTime, float InValue, const bool bUnwindRotation=false, FKeyHandle KeyHandle=FKeyHandle()) PURE_VIRTUAL(FRealCurve
 
virtual void virtual DeleteKey(FKeyHandle KeyHandle) PURE_VIRTUAL(FRealCurve FKeyHandle UpdateOrAddKey (float InTime, float InValue, const bool bUnwindRotation=false, float KeyTimeTolerance=UE_KINDA_SMALL_NUMBER) PURE_VIRTUAL(FRealCurve
 
virtual void virtual SetKeyValue(FKeyHandle KeyHandle, float NewValue, bool bAutoSetTangents=true) PURE_VIRTUAL(FRealCurve float GetKeyValue (FKeyHandle KeyHandle) const PURE_VIRTUAL(FRealCurve
 
virtual TPair< float, floatGetKeyTimeValuePair (FKeyHandle KeyHandle) const PURE_VIRTUAL(FRealCurve
 
virtual ERichCurveInterpMode GetKeyInterpMode (FKeyHandle KeyHandle) const PURE_VIRTUAL(FRealCurve
 
virtual void virtual GetTimeRange(float &MinTime, float &MaxTime) const PURE_VIRTUAL(FRealCurve void virtual GetValueRange(float &MinValue, float &MaxValue) const PURE_VIRTUAL(FRealCurve void virtual Reset() PURE_VIRTUAL(FRealCurve void virtual RemapTimeValue(float &InTime, float &CycleValueOffset) const PURE_VIRTUAL(FRealCurve float Eval (float InTime, float InDefaultValue=0.0f) const PURE_VIRTUAL(FRealCurve
 
float DefaultValue
 
TEnumAsByte< ERichCurveExtrapolationPreInfinityExtrap
 
TEnumAsByte< ERichCurveExtrapolationPostInfinityExtrap
 
- Public Attributes inherited from FIndexedCurve
virtual int32 GetNumKeys () const PURE_VIRTUAL(FIndexedCurve
 
virtual void virtual SetKeyTime(FKeyHandle KeyHandle, float NewTime) PURE_VIRTUAL(FIndexedCurve float GetKeyTime (FKeyHandle KeyHandle) const PURE_VIRTUAL(FIndexedCurve
 
virtual FIndexedCurveDuplicate () const PURE_VIRTUAL(FIndexedCurve
 

Additional Inherited Members

- Protected Member Functions inherited from FIndexedCurve
void EnsureAllIndicesHaveHandles () const
 
void EnsureIndexHasAHandle (int32 KeyIndex) const
 
const int32FindIndex (FKeyHandle KeyHandle) const
 
ENGINE_API int32 GetIndex (FKeyHandle KeyHandle) const
 
ENGINE_API FKeyHandle GetKeyHandle (int32 KeyIndex) const
 
- Static Protected Member Functions inherited from FRealCurve
static ENGINE_API void CycleTime (float MinTime, float MaxTime, float &InTime, int &CycleCount)
 
- Protected Attributes inherited from FRealCurve
virtual int32 GetKeyIndex (float KeyTime, float KeyTimeTolerance) const PURE_VIRTUAL(FRealCurve
 
- Protected Attributes inherited from FIndexedCurve
FKeyHandleMap KeyHandlesToIndices
 

Detailed Description

A rich, editable float curve

Member Function Documentation

◆ AddKey()

FKeyHandle FRichCurve::AddKey ( float  InTime,
float  InValue,
const bool  bUnwindRotation = false,
FKeyHandle  KeyHandle = FKeyHandle() 
)
finaloverridevirtual

Add a new key to the curve with the supplied Time and Value. Returns the handle of the new key.

Parameters
bUnwindRotationWhen true, the value will be treated like a rotation value in degrees, and will automatically be unwound to prevent flipping 360 degrees from the previous key
KeyHandleOptionally can specify what handle this new key should have, otherwise, it'll make a new one

◆ AutoSetTangents()

void FRichCurve::AutoSetTangents ( float  Tension = 0.f)

Auto set tangents for any 'auto' keys in curve

◆ BakeCurve() [1/2]

void FRichCurve::BakeCurve ( float  SampleRate)
finaloverridevirtual

Bake curve given the sample rate

◆ BakeCurve() [2/2]

void FRichCurve::BakeCurve ( float  SampleRate,
float  FirstKeyTime,
float  LastKeyTime 
)
finaloverridevirtual

◆ CompressCurve()

void FRichCurve::CompressCurve ( struct FCompressedRichCurve OutCurve,
float  ErrorThreshold = 0.0001f,
float  SampleRate = 120.0 
) const

Compresses a rich curve for efficient runtime storage and evaluation

◆ ConvertToChaosCurve()

void FRichCurve::ConvertToChaosCurve ( Chaos::FLinearCurve OutCurve) const

Convert a rich curve to Chaos FLinearCurve

◆ DeleteKey()

void FRichCurve::DeleteKey ( FKeyHandle  KeyHandle)
finaloverride

Remove the specified key from the curve.

Parameters
KeyHandleThe handle of the key to remove.
See also
AddKey, SetKeys

◆ Duplicate()

virtual FIndexedCurve * FRichCurve::Duplicate ( ) const
inlinefinalvirtual

Allocates a duplicate of the curve

◆ Eval()

float FRichCurve::Eval ( float  InTime,
float  InDefaultValue = 0.0f 
) const
finaloverridevirtual

Evaluate this rich curve at the specified time

◆ GetConstRefOfKeys()

const TArray< FRichCurveKey > & FRichCurve::GetConstRefOfKeys ( ) const

Gets a const reference of the keys, so indices and handles can't be meddled with

◆ GetCopyOfKeys()

TArray< FRichCurveKey > FRichCurve::GetCopyOfKeys ( ) const

Gets a copy of the keys, so indices and handles can't be meddled with

◆ GetFirstKey()

FRichCurveKey FRichCurve::GetFirstKey ( ) const

Quick accessors for the first and last keys

◆ GetFirstMatchingKey()

FRichCurveKey * FRichCurve::GetFirstMatchingKey ( const TArray< FKeyHandle > &  KeyHandles)

Get the first key that matches any of the given key handles.

◆ GetKey() [1/2]

FRichCurveKey & FRichCurve::GetKey ( FKeyHandle  KeyHandle)

Functions for getting keys based on handles

◆ GetKey() [2/2]

FRichCurveKey FRichCurve::GetKey ( FKeyHandle  KeyHandle) const

◆ GetKeyInterpMode()

ERichCurveInterpMode FRichCurve::GetKeyInterpMode ( FKeyHandle  KeyHandle) const
finaloverridevirtual

Get the interp mode of the specified key

◆ GetKeyIterator()

TArray< FRichCurveKey >::TConstIterator FRichCurve::GetKeyIterator ( ) const

Const iterator for the keys, so the indices and handles stay valid

◆ GetKeyRef()

const FRichCurveKey & FRichCurve::GetKeyRef ( FKeyHandle  KeyHandle) const

◆ GetKeyTangentMode()

ERichCurveTangentMode FRichCurve::GetKeyTangentMode ( FKeyHandle  KeyHandle) const

Get the tangent mode of the specified key

◆ GetKeyTime()

float FRichCurve::GetKeyTime ( FKeyHandle  KeyHandle) const
finaloverridevirtual

Get the time for the Key with the specified index.

◆ GetKeyTimeValuePair()

TPair< float, float > FRichCurve::GetKeyTimeValuePair ( FKeyHandle  KeyHandle) const
finaloverridevirtual

Returns a <Time, Value> pair for the specified key

◆ GetKeyValue()

float FRichCurve::GetKeyValue ( FKeyHandle  KeyHandle) const
finaloverridevirtual

Returns the value of the specified key

◆ GetLastKey()

FRichCurveKey FRichCurve::GetLastKey ( ) const

◆ GetNumKeys()

virtual int32 FRichCurve::GetNumKeys ( ) const
inlinefinaloverridevirtual

◆ GetTimeRange()

void FRichCurve::GetTimeRange ( float MinTime,
float MaxTime 
) const
finaloverridevirtual

Get range of input time values. Outside this region curve continues constantly the start/end values.

◆ GetValueRange()

void FRichCurve::GetValueRange ( float MinValue,
float MaxValue 
) const
finaloverridevirtual

Get range of output values.

◆ IsConstant()

bool FRichCurve::IsConstant ( float  Tolerance = UE_SMALL_NUMBER) const

Returns whether the curve is constant or not

◆ IsEmpty()

bool FRichCurve::IsEmpty ( ) const
inline

Returns whether the curve is empty or not

◆ operator==()

bool FRichCurve::operator== ( const FRichCurve Curve) const

Determine if two RichCurves are the same

◆ ReadjustTimeRange()

void FRichCurve::ReadjustTimeRange ( float  NewMinTimeRange,
float  NewMaxTimeRange,
bool  bInsert,
float  OldStartTime,
float  OldEndTime 
)
finaloverridevirtual

Resize curve length to the [MinTimeRange, MaxTimeRange]

◆ RemapTimeValue()

void FRichCurve::RemapTimeValue ( float InTime,
float CycleValueOffset 
) const
finaloverridevirtual

Remap InTime based on pre and post infinity extrapolation values

◆ RemoveRedundantAutoTangentKeys() [1/2]

void FRichCurve::RemoveRedundantAutoTangentKeys ( float  Tolerance)

Remove redundant keys, comparing against Tolerance

◆ RemoveRedundantAutoTangentKeys() [2/2]

void FRichCurve::RemoveRedundantAutoTangentKeys ( float  Tolerance,
float  FirstKeyTime,
float  LastKeyTime 
)

◆ RemoveRedundantKeys() [1/2]

void FRichCurve::RemoveRedundantKeys ( float  Tolerance,
FFrameRate  SampleRate 
)
finaloverridevirtual

◆ RemoveRedundantKeys() [2/2]

void FRichCurve::RemoveRedundantKeys ( float  Tolerance,
float  FirstKeyTime,
float  LastKeyTime,
FFrameRate  SampleRate 
)
finaloverridevirtual

◆ ReserveKeys()

void FRichCurve::ReserveKeys ( const int32  Number)

Reserves keys to be added by AddKey.

See also
AddKey

◆ Reset()

void FRichCurve::Reset ( )
finaloverridevirtual

Clear all keys.

◆ SetKeyInterpMode() [1/2]

void FRichCurve::SetKeyInterpMode ( FKeyHandle  KeyHandle,
ERichCurveInterpMode  NewInterpMode 
)
finaloverridevirtual

Set the interp mode of the specified key

◆ SetKeyInterpMode() [2/2]

void FRichCurve::SetKeyInterpMode ( FKeyHandle  KeyHandle,
ERichCurveInterpMode  NewInterpMode,
bool  bAutoSetTangents 
)

◆ SetKeys()

void FRichCurve::SetKeys ( const TArray< FRichCurveKey > &  InKeys)

Sets the keys with the keys.

Expects that the keys are already sorted.

See also
AddKey, DeleteKey

◆ SetKeyTangentMode()

void FRichCurve::SetKeyTangentMode ( FKeyHandle  KeyHandle,
ERichCurveTangentMode  NewTangentMode,
bool  bAutoSetTangents = true 
)

Set the tangent mode of the specified key

◆ SetKeyTangentWeightMode()

void FRichCurve::SetKeyTangentWeightMode ( FKeyHandle  KeyHandle,
ERichCurveTangentWeightMode  NewTangentWeightMode,
bool  bAutoSetTangents = true 
)

Set the tangent weight mode of the specified key

◆ SetKeyTime()

void FRichCurve::SetKeyTime ( FKeyHandle  KeyHandle,
float  NewTime 
)
finaloverridevirtual

Move a key to a new time.

◆ SetKeyValue()

void FRichCurve::SetKeyValue ( FKeyHandle  KeyHandle,
float  NewValue,
bool  bAutoSetTangents = true 
)
finaloverridevirtual

Set the value of the specified key

◆ UpdateOrAddKey()

FKeyHandle FRichCurve::UpdateOrAddKey ( float  InTime,
float  InValue,
const bool  bUnwindRotation = false,
float  KeyTimeTolerance = UE_KINDA_SMALL_NUMBER 
)
finaloverridevirtual

Finds the key at InTime, and updates its value. If it can't find the key within the KeyTimeTolerance, it adds one at that time

Member Data Documentation

◆ Keys

TArray<FRichCurveKey> FRichCurve::Keys

Sorted array of keys


The documentation for this struct was generated from the following files: