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

#include <InterpCurve.h>

Public Types

using ElementType = T
 

Public Member Functions

 FInterpCurve ()
 
int32 AddPoint (const float InVal, const T &OutVal)
 
int32 MovePoint (int32 PointIndex, float NewInVal)
 
void Reset ()
 
void SetLoopKey (float InLoopKey)
 
void ClearLoopKey ()
 
Eval (const float InVal, const T &Default=T(ForceInit)) const
 
EvalDerivative (const float InVal, const T &Default=T(ForceInit)) const
 
EvalSecondDerivative (const float InVal, const T &Default=T(ForceInit)) const
 
float FindNearest (const T &PointInSpace, float &OutDistanceSq) const
 
float InaccurateFindNearest (const T &PointInSpace, float &OutDistanceSq) const
 
float FindNearest (const T &PointInSpace, float &OutDistanceSq, float &OutSegment) const
 
float InaccurateFindNearest (const T &PointInSpace, float &OutDistanceSq, float &OutSegment) const
 
float FindNearestOnSegment (const T &PointInSpace, int32 PtIdx, float &OutSquaredDistance) const
 
float InaccurateFindNearestOnSegment (const T &PointInSpace, int32 PtIdx, float &OutSquaredDistance) const
 
void AutoSetTangents (float Tension=0.0f, bool bStationaryEndpoints=true)
 
void CalcBounds (T &OutMin, T &OutMax, const T &Default=T(ForceInit)) const
 
FFloatInterval GetKeyInterval () const
 
int32 GetPointIndexForInputValue (const float InValue) const
 

Public Attributes

TArray< FInterpCurvePoint< T > > Points
 
bool bIsLooped
 
float LoopKeyOffset
 

Friends

FArchiveoperator<< (FArchive &Ar, FInterpCurve &Curve)
 
bool operator== (const FInterpCurve &Curve1, const FInterpCurve &Curve2)
 
bool operator!= (const FInterpCurve &Curve1, const FInterpCurve &Curve2)
 

Detailed Description

template<class T>
class FInterpCurve< T >

Template for interpolation curves.

See also
FInterpCurvePoint

Member Typedef Documentation

◆ ElementType

template<class T >
using FInterpCurve< T >::ElementType = T

Constructor & Destructor Documentation

◆ FInterpCurve()

template<class T >
FInterpCurve< T >::FInterpCurve ( )
inline

Default constructor.

Member Function Documentation

◆ AddPoint()

template<class T >
int32 FInterpCurve< T >::AddPoint ( const float  InVal,
const T &  OutVal 
)

Adds a new keypoint to the InterpCurve with the supplied In and Out value.

Parameters
InVal
OutVal
Returns
The index of the new key.

◆ AutoSetTangents()

template<class T >
void FInterpCurve< T >::AutoSetTangents ( float  Tension = 0.0f,
bool  bStationaryEndpoints = true 
)

Automatically set the tangents on the curve based on surrounding points

◆ CalcBounds()

template<class T >
void FInterpCurve< T >::CalcBounds ( T &  OutMin,
T &  OutMax,
const T &  Default = T(ForceInit) 
) const

Calculate the min/max out value that can be returned by this InterpCurve.

◆ ClearLoopKey()

template<class T >
void FInterpCurve< T >::ClearLoopKey ( )

Clear loop key for curve

◆ Eval()

template<class T >
T FInterpCurve< T >::Eval ( const float  InVal,
const T &  Default = T(ForceInit) 
) const

Evaluate the output for an arbitrary input value. For inputs outside the range of the keys, the first/last key value is assumed.

◆ EvalDerivative()

template<class T >
T FInterpCurve< T >::EvalDerivative ( const float  InVal,
const T &  Default = T(ForceInit) 
) const

Evaluate the derivative at a point on the curve.

◆ EvalSecondDerivative()

template<class T >
T FInterpCurve< T >::EvalSecondDerivative ( const float  InVal,
const T &  Default = T(ForceInit) 
) const

Evaluate the second derivative at a point on the curve.

◆ FindNearest() [1/2]

template<class T >
float FInterpCurve< T >::FindNearest ( const T &  PointInSpace,
float OutDistanceSq 
) const

Find the nearest point on spline to the given point.

Parameters
PointInSpace- the given point
OutDistanceSq- output - the squared distance between the given point and the closest found point.
Returns
The key (the 't' parameter) of the nearest point.

◆ FindNearest() [2/2]

template<class T >
float FInterpCurve< T >::FindNearest ( const T &  PointInSpace,
float OutDistanceSq,
float OutSegment 
) const

Find the nearest point on spline to the given point.

Parameters
PointInSpace- the given point
OutDistanceSq- output - the squared distance between the given point and the closest found point.
OutSegment- output - the nearest segment to the given point.
Returns
The key (the 't' parameter) of the nearest point.

◆ FindNearestOnSegment()

template<class T >
float FInterpCurve< T >::FindNearestOnSegment ( const T &  PointInSpace,
int32  PtIdx,
float OutSquaredDistance 
) const

Find the nearest point (to the given point) on segment between Points[PtIdx] and Points[PtIdx+1]

Parameters
PointInSpace- the given point
Returns
The key (the 't' parameter) of the found point.

◆ GetKeyInterval()

template<class T >
FFloatInterval FInterpCurve< T >::GetKeyInterval ( ) const

Returns the interval of key for the curve points

◆ GetPointIndexForInputValue()

template<class T >
int32 FInterpCurve< T >::GetPointIndexForInputValue ( const float  InValue) const

Finds the lower index of the two points whose input values bound the supplied input value.

◆ InaccurateFindNearest() [1/2]

template<class T >
float FInterpCurve< T >::InaccurateFindNearest ( const T &  PointInSpace,
float OutDistanceSq 
) const

◆ InaccurateFindNearest() [2/2]

template<class T >
float FInterpCurve< T >::InaccurateFindNearest ( const T &  PointInSpace,
float OutDistanceSq,
float OutSegment 
) const

◆ InaccurateFindNearestOnSegment()

template<class T >
float FInterpCurve< T >::InaccurateFindNearestOnSegment ( const T &  PointInSpace,
int32  PtIdx,
float OutSquaredDistance 
) const

◆ MovePoint()

template<class T >
int32 FInterpCurve< T >::MovePoint ( int32  PointIndex,
float  NewInVal 
)

Moves a keypoint to a new In value.

This may change the index of the keypoint, so the new key index is returned.

Parameters
PointIndex
NewInVal
Returns

◆ Reset()

template<class T >
void FInterpCurve< T >::Reset ( )

Clears all keypoints from InterpCurve.

◆ SetLoopKey()

template<class T >
void FInterpCurve< T >::SetLoopKey ( float  InLoopKey)

Set loop key for curve

Friends And Related Symbol Documentation

◆ operator!=

template<class T >
bool operator!= ( const FInterpCurve< T > &  Curve1,
const FInterpCurve< T > &  Curve2 
)
friend

Compare inequality of two FInterpCurves

◆ operator<<

template<class T >
FArchive & operator<< ( FArchive Ar,
FInterpCurve< T > &  Curve 
)
friend

Serializes the interp curve.

Parameters
ArReference to the serialization archive.
CurveReference to the interp curve being serialized.
Returns
Reference to the Archive after serialization.

◆ operator==

template<class T >
bool operator== ( const FInterpCurve< T > &  Curve1,
const FInterpCurve< T > &  Curve2 
)
friend

Compare equality of two FInterpCurves

Member Data Documentation

◆ bIsLooped

template<class T >
bool FInterpCurve< T >::bIsLooped

Specify whether the curve is looped or not

◆ LoopKeyOffset

template<class T >
float FInterpCurve< T >::LoopKeyOffset

Specify the offset from the last point's input key corresponding to the loop point

◆ Points

template<class T >
TArray<FInterpCurvePoint<T> > FInterpCurve< T >::Points

Holds the collection of interpolation points.


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