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

#include <SimpleCurve.h>

+ Inheritance diagram for FSimpleCurve:

Public Member Functions

 FSimpleCurve ()
 
ENGINE_API TArray< FSimpleCurveKeyGetCopyOfKeys () const
 
ENGINE_API const TArray< FSimpleCurveKey > & GetConstRefOfKeys () const
 
ENGINE_API TArray< FSimpleCurveKey >::TConstIterator GetKeyIterator () const
 
ENGINE_API FSimpleCurveKeyGetKey (FKeyHandle KeyHandle)
 
ENGINE_API FSimpleCurveKey GetKey (FKeyHandle KeyHandle) const
 
ENGINE_API FSimpleCurveKey GetFirstKey () const
 
ENGINE_API FSimpleCurveKey GetLastKey () const
 
ENGINE_API FSimpleCurveKeyGetFirstMatchingKey (const TArray< FKeyHandle > &KeyHandles)
 
ENGINE_API FKeyHandle AddKey (float InTime, float InValue, const bool bUnwindRotation=false, FKeyHandle KeyHandle=FKeyHandle()) final override
 
ENGINE_API void SetKeys (const TArray< FSimpleCurveKey > &InKeys)
 
virtual 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
 
virtual void SetKeyInterpMode (FKeyHandle, ERichCurveInterpMode NewInterpMode) final override
 
void SetKeyInterpMode (ERichCurveInterpMode NewInterpMode)
 
virtual ERichCurveInterpMode GetKeyInterpMode (FKeyHandle KeyHandle) const final override
 
ERichCurveInterpMode GetKeyInterpMode () 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
 
virtual ENGINE_API void ReadjustTimeRange (float NewMinTimeRange, float NewMaxTimeRange, bool bInsert, float OldStartTime, float OldEndTime) final override
 
ENGINE_API bool operator== (const FSimpleCurve &Curve) const
 
virtual ENGINE_API void BakeCurve (float SampleRate) final override
 
virtual ENGINE_API void BakeCurve (float SampleRate, float FirstKeyTime, float LastKeyTime) final override
 
virtual ENGINE_API void RemoveRedundantKeys (float Tolerance, FFrameRate SampleRate=FFrameRate(0, 0)) final override
 
virtual ENGINE_API void RemoveRedundantKeys (float Tolerance, float FirstKeyTime, float LastKeyTime, FFrameRate SampleRate=FFrameRate(0, 0)) final override
 
virtual FIndexedCurveDuplicate () const final
 
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

TEnumAsByte< ERichCurveInterpModeInterpMode
 
TArray< FSimpleCurveKeyKeys
 
- 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
 

Protected Member Functions

virtual ENGINE_API int32 GetKeyIndex (float KeyTime, float KeyTimeTolerance) const override final
 
- 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
 

Additional Inherited Members

- 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

Constructor & Destructor Documentation

◆ FSimpleCurve()

FSimpleCurve::FSimpleCurve ( )
inline

Member Function Documentation

◆ AddKey()

FKeyHandle FSimpleCurve::AddKey ( float  InTime,
float  InValue,
const bool  bUnwindRotation = false,
FKeyHandle  KeyHandle = FKeyHandle() 
)
finaloverride

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

◆ BakeCurve() [1/2]

void FSimpleCurve::BakeCurve ( float  SampleRate)
finaloverridevirtual

Bake curve given the sample rate

◆ BakeCurve() [2/2]

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

◆ DeleteKey()

void FSimpleCurve::DeleteKey ( FKeyHandle  KeyHandle)
finaloverridevirtual

Remove the specified key from the curve.

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

◆ Duplicate()

virtual FIndexedCurve * FSimpleCurve::Duplicate ( ) const
inlinefinalvirtual

Allocates a duplicate of the curve

◆ Eval()

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

Evaluate this curve at the specified time

◆ GetConstRefOfKeys()

const TArray< FSimpleCurveKey > & FSimpleCurve::GetConstRefOfKeys ( ) const

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

◆ GetCopyOfKeys()

TArray< FSimpleCurveKey > FSimpleCurve::GetCopyOfKeys ( ) const

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

◆ GetFirstKey()

FSimpleCurveKey FSimpleCurve::GetFirstKey ( ) const

Quick accessors for the first and last keys

◆ GetFirstMatchingKey()

FSimpleCurveKey * FSimpleCurve::GetFirstMatchingKey ( const TArray< FKeyHandle > &  KeyHandles)

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

◆ GetKey() [1/2]

FSimpleCurveKey & FSimpleCurve::GetKey ( FKeyHandle  KeyHandle)

Functions for getting keys based on handles

◆ GetKey() [2/2]

FSimpleCurveKey FSimpleCurve::GetKey ( FKeyHandle  KeyHandle) const

◆ GetKeyIndex()

int32 FSimpleCurve::GetKeyIndex ( float  KeyTime,
float  KeyTimeTolerance 
) const
finaloverrideprotectedvirtual

◆ GetKeyInterpMode() [1/2]

ERichCurveInterpMode FSimpleCurve::GetKeyInterpMode ( ) const
inline

Get the interp mode used for keys in this curve

◆ GetKeyInterpMode() [2/2]

virtual ERichCurveInterpMode FSimpleCurve::GetKeyInterpMode ( FKeyHandle  KeyHandle) const
inlinefinaloverridevirtual

Get the interp mode of the specified key

◆ GetKeyIterator()

TArray< FSimpleCurveKey >::TConstIterator FSimpleCurve::GetKeyIterator ( ) const

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

◆ GetKeyTime()

float FSimpleCurve::GetKeyTime ( FKeyHandle  KeyHandle) const
finaloverridevirtual

Get the time for the Key with the specified index.

◆ GetKeyTimeValuePair()

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

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

◆ GetKeyValue()

float FSimpleCurve::GetKeyValue ( FKeyHandle  KeyHandle) const
finaloverridevirtual

Returns the value of the specified key

◆ GetLastKey()

FSimpleCurveKey FSimpleCurve::GetLastKey ( ) const

◆ GetNumKeys()

virtual int32 FSimpleCurve::GetNumKeys ( ) const
inlinefinaloverridevirtual

◆ GetTimeRange()

void FSimpleCurve::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 FSimpleCurve::GetValueRange ( float MinValue,
float MaxValue 
) const
finaloverridevirtual

Get range of output values.

◆ operator==()

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

Determine if two SimpleCurves are the same

◆ ReadjustTimeRange()

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

Resize curve length to the [MinTimeRange, MaxTimeRange]

◆ RemapTimeValue()

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

Remap InTime based on pre and post infinity extrapolation values

◆ RemoveRedundantKeys() [1/2]

void FSimpleCurve::RemoveRedundantKeys ( float  Tolerance,
FFrameRate  SampleRate = FFrameRate(0,0) 
)
finaloverridevirtual

Remove redundant keys, comparing against Tolerance

◆ RemoveRedundantKeys() [2/2]

void FSimpleCurve::RemoveRedundantKeys ( float  Tolerance,
float  FirstKeyTime,
float  LastKeyTime,
FFrameRate  SampleRate = FFrameRate(0,0) 
)
finaloverridevirtual

◆ Reset()

void FSimpleCurve::Reset ( )
finaloverridevirtual

Clear all keys.

◆ SetKeyInterpMode() [1/2]

void FSimpleCurve::SetKeyInterpMode ( ERichCurveInterpMode  NewInterpMode)
inline

◆ SetKeyInterpMode() [2/2]

virtual void FSimpleCurve::SetKeyInterpMode ( FKeyHandle  ,
ERichCurveInterpMode  NewInterpMode 
)
inlinefinaloverridevirtual

Set the interp mode used for keys in this curve

◆ SetKeys()

void FSimpleCurve::SetKeys ( const TArray< FSimpleCurveKey > &  InKeys)

Sets the keys with the keys.

Expects that the keys are already sorted.

See also
AddKey, DeleteKey

◆ SetKeyTime()

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

Move a key to a new time.

◆ SetKeyValue()

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

Set the value of the specified key

◆ UpdateOrAddKey()

FKeyHandle FSimpleCurve::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

◆ InterpMode

TEnumAsByte<ERichCurveInterpMode> FSimpleCurve::InterpMode

Interpolation mode between this key and the next

◆ Keys

TArray<FSimpleCurveKey> FSimpleCurve::Keys

Sorted array of keys


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