8#include "Containers/Array.h"
138 void AutoSetTangents(
float Tension = 0.0f,
bool bStationaryEndpoints =
true);
164 Ar << Curve.bIsLooped;
165 Ar << Curve.LoopKeyOffset;
202 int32 i=0;
for( i=0; i<Points.
Num() && Points[i].InVal < InVal; i++);
242 if (Points.
Num() == 0)
273 const int32 NumPoints = Points.
Num();
276 check(NumPoints > 0);
289 int32 MaxIndex = NumPoints;
291 while (MaxIndex - MinIndex > 1)
293 int32 MidIndex = (MinIndex + MaxIndex) / 2;
295 if (Points[MidIndex].InVal <=
InValue)
312 const int32 NumPoints = Points.
Num();
322 if (FPlatformMath::IsNaN(InVal))
324#if ENABLE_NAN_DIAGNOSTIC
331 const int32 Index = GetPointIndexForInputValue(InVal);
336 return Points[0].OutVal;
346 else if (InVal >= Points[
LastPoint].InVal + LoopKeyOffset)
349 return Points[0].OutVal;
359 const auto&
NextPoint = Points[NextIndex];
379 return Points[
Index].OutVal;
387 const int32 NumPoints = Points.
Num();
397 if (FPlatformMath::IsNaN(InVal))
399#if ENABLE_NAN_DIAGNOSTIC
406 const int32 Index = GetPointIndexForInputValue(InVal);
411 return Points[0].LeaveTangent;
421 else if (InVal >= Points[
LastPoint].InVal + LoopKeyOffset)
424 return Points[0].ArriveTangent;
434 const auto&
NextPoint = Points[NextIndex];
462 const int32 NumPoints = Points.
Num();
472 if (FPlatformMath::IsNaN(InVal))
474#if ENABLE_NAN_DIAGNOSTIC
481 const int32 Index = GetPointIndexForInputValue(InVal);
492 if (!bIsLooped || (InVal >= Points[
LastPoint].InVal + LoopKeyOffset))
504 const auto&
NextPoint = Points[NextIndex];
547 const int32 NumPoints = Points.
Num();
548 const int32 NumSegments = bIsLooped ? NumPoints : NumPoints - 1;
575 return Points[0].InVal;
590 const int32 NumPoints = Points.
Num();
604 return Points[
PtIdx].InVal;
615 const float B =
static_cast<float>((Points[
NextPtIdx].OutVal - Points[
PtIdx].OutVal).SizeSquared());
618 return V * Diff + Points[
PtIdx].InVal;
629 const T
CubicCoeffs[4] = { P0, T0, -3 * P0 - 2 * T0 - T1 + 3 * P1, 2 * P0 + T0 + T1 - 2 * P1 };
643 float BestDistSq =
static_cast<float>(P0.SizeSquared());
645 float EndDistSq =
static_cast<float>(P1.SizeSquared());
679 const int32 NumPoints = Points.
Num();
689 const auto&
PrevPoint = Points[PrevIndex];
690 const auto&
NextPoint = Points[NextIndex];
748 const int32 NumPoints = Points.
Num();
755 else if (NumPoints == 1)
757 OutMin = Points[0].OutVal;
758 OutMax = Points[0].OutVal;
762 OutMin = Points[0].OutVal;
763 OutMax = Points[0].OutVal;
765 const int32 NumSegments = bIsLooped ? NumPoints : (NumPoints - 1);
789#define DEFINE_INTERPCURVE_WRAPPER_STRUCT(Name, ElementType) \
790 struct Name : FInterpCurve<ElementType> \
793 typedef FInterpCurve<ElementType> Super; \
801 Name(const Super& Other) \
808 struct TIsBitwiseConstructible<Name, FInterpCurve<ElementType>> \
810 enum { Value = true }; \
814 struct TIsBitwiseConstructible<FInterpCurve<ElementType>, Name> \
816 enum { Value = true }; \
#define check(expr)
Definition AssertionMacros.h:314
#define checkf(expr, format,...)
Definition AssertionMacros.h:315
@ ForceInit
Definition CoreMiscDefines.h:155
UE_FORCEINLINE_HINT TSharedRef< CastToType, Mode > StaticCastSharedRef(TSharedRef< CastFromType, Mode > const &InSharedRef)
Definition SharedPointer.h:127
void ComputeCurveTangent(float PrevTime, const T &PrevPoint, float CurTime, const T &CurPoint, float NextTime, const T &NextPoint, float Tension, bool bWantClamping, T &OutTangent)
Definition InterpCurvePoint.h:214
EInterpCurveMode
Definition InterpCurvePoint.h:16
@ CIM_CurveAutoClamped
Definition InterpCurvePoint.h:35
@ CIM_Linear
Definition InterpCurvePoint.h:18
@ CIM_Constant
Definition InterpCurvePoint.h:25
@ CIM_CurveAuto
Definition InterpCurvePoint.h:22
void CurveFindIntervalBounds(const FInterpCurvePoint< T > &Start, const FInterpCurvePoint< T > &End, T &CurrentMin, T &CurrentMax, const U &Dummy)
Definition InterpCurvePoint.h:402
#define DEFINE_INTERPCURVE_WRAPPER_STRUCT(Name, ElementType)
Definition InterpCurve.h:789
#define logOrEnsureNanError(_FormatString_,...)
Definition LogMacros.h:436
@ VER_UE4_INTERPCURVE_SUPPORTS_LOOPING
Definition ObjectVersion.h:599
USkinnedMeshComponent float
Definition SkinnedMeshComponent.h:60
Definition Archive.h:1208
UE_FORCEINLINE_HINT FPackageFileVersion UEVer() const
Definition Archive.h:204
Definition InterpCurve.h:26
void SetLoopKey(float InLoopKey)
Definition InterpCurve.h:239
T ElementType
Definition InterpCurve.h:39
void ClearLoopKey()
Definition InterpCurve.h:264
int32 GetPointIndexForInputValue(const float InValue) const
Definition InterpCurve.h:271
void CalcBounds(T &OutMin, T &OutMax, const T &Default=T(ForceInit)) const
Definition InterpCurve.h:746
float InaccurateFindNearest(const T &PointInSpace, float &OutDistanceSq) const
Definition InterpCurve.h:538
T Eval(const float InVal, const T &Default=T(ForceInit)) const
Definition InterpCurve.h:310
float LoopKeyOffset
Definition InterpCurve.h:36
friend bool operator==(const FInterpCurve &Curve1, const FInterpCurve &Curve2)
Definition InterpCurve.h:174
friend FArchive & operator<<(FArchive &Ar, FInterpCurve &Curve)
Definition InterpCurve.h:156
friend bool operator!=(const FInterpCurve &Curve1, const FInterpCurve &Curve2)
Definition InterpCurve.h:184
TArray< FInterpCurvePoint< T > > Points
Definition InterpCurve.h:30
T EvalDerivative(const float InVal, const T &Default=T(ForceInit)) const
Definition InterpCurve.h:385
T EvalSecondDerivative(const float InVal, const T &Default=T(ForceInit)) const
Definition InterpCurve.h:460
float InaccurateFindNearestOnSegment(const T &PointInSpace, int32 PtIdx, float &OutSquaredDistance) const
Definition InterpCurve.h:671
FInterpCurve()
Definition InterpCurve.h:42
bool bIsLooped
Definition InterpCurve.h:33
void Reset()
Definition InterpCurve.h:232
FFloatInterval GetKeyInterval() const
Definition InterpCurve.h:776
float FindNearestOnSegment(const T &PointInSpace, int32 PtIdx, float &OutSquaredDistance) const
Definition InterpCurve.h:588
int32 MovePoint(int32 PointIndex, float NewInVal)
Definition InterpCurve.h:210
int32 AddPoint(const float InVal, const T &OutVal)
Definition InterpCurve.h:200
void AutoSetTangents(float Tension=0.0f, bool bStationaryEndpoints=true)
Definition InterpCurve.h:677
float FindNearest(const T &PointInSpace, float &OutDistanceSq) const
Definition InterpCurve.h:531
UE_REWRITE SizeType Num() const
Definition Array.h:1144
UE_NODEBUG UE_FORCEINLINE_HINT ElementType & Last(SizeType IndexFromTheEnd=0) UE_LIFETIMEBOUND
Definition Array.h:1263
UE_NODEBUG UE_FORCEINLINE_HINT void InsertUninitialized(SizeType Index)
Definition Array.h:1782
void RemoveAt(SizeType Index, EAllowShrinking AllowShrinking=UE::Core::Private::AllowShrinkingByDefault< AllocatorType >())
Definition Array.h:2083
UE_REWRITE bool IsEmpty() const
Definition Array.h:1133
void Empty(SizeType Slack=0)
Definition Array.h:2273
Definition StaticArray.h:26
@ false
Definition radaudio_common.h:23
U16 Index
Definition radfft.cpp:71
static constexpr T CubicInterpDerivative(const T &P0, const T &T0, const T &P1, const T &T1, const U &A)
Definition UnrealMathUtility.h:1241
static constexpr UE_FORCEINLINE_HINT T Lerp(const T &A, const T &B, const U &Alpha)
Definition UnrealMathUtility.h:1116
static constexpr T CubicInterp(const T &P0, const T &T0, const T &P1, const T &T1, const U &A)
Definition UnrealMathUtility.h:1212
static constexpr T CubicInterpSecondDerivative(const T &P0, const T &T0, const T &P1, const T &T1, const U &A)
Definition UnrealMathUtility.h:1262
static constexpr UE_FORCEINLINE_HINT T Clamp(const T X, const T MinValue, const T MaxValue)
Definition UnrealMathUtility.h:592
Definition TwoVectors.h:15
Definition PolynomialRootSolver.h:18