UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
LinearSpline.h
Go to the documentation of this file.
1// Copyright Epic Games, Inc. All Rights Reserved.
2
3#pragma once
4
5#include "BSpline.h"
6namespace UE
7{
8namespace Geometry
9{
10namespace Spline
11{
12
13template<typename T> class UE_EXPERIMENTAL(5.7, "") TLinearSpline;
14
15template<typename T>
16class TLinearSpline : public TBSpline<T, 1>
17{
18public:
20
22
24 {
25 }
26
27 virtual float GetParameter(int32 Index) const override
28 {
29 return (Index >= 0 && Index + 1 < this->Knots.Num())
30 ? this->Knots[Index + 1]
31 : 0.0f;
32 }
33
34 virtual bool SetParameter(int32 Index, float NewParam) override
35 {
36 if (Index < 0 || Index + 1 >= this->Knots.Num())
37 return false;
38
39 float Prev = (Index > 0) ? this->Knots[Index] : -FLT_MAX;
40 float Next = (Index + 2 < this->Knots.Num()) ? this->Knots[Index + 2] : FLT_MAX;
41
43 return false;
44
45 this->Knots[Index + 1] = NewParam;
46 return true;
47 }
48
49};
50
53
54} // end namespace UE::Geometry::Spline
55} // end namespace UE::Geometry
56} // end namespace UE
#define UE_EXPERIMENTAL(Version, Message)
Definition CoreMiscDefines.h:369
#define TEXT(x)
Definition Platform.h:1272
FPlatformTypes::int32 int32
A 32-bit signed integer.
Definition Platform.h:1125
UE_FORCEINLINE_HINT TSharedRef< CastToType, Mode > StaticCastSharedRef(TSharedRef< CastFromType, Mode > const &InSharedRef)
Definition SharedPointer.h:127
Definition BSpline.h:126
Definition LinearSpline.h:17
virtual float GetParameter(int32 Index) const override
Definition LinearSpline.h:27
DECLARE_SPLINE_TYPE_ID(TEXT("BSpline1"), *TSplineValueTypeTraits< T >::Name)
TLinearSpline()
Definition LinearSpline.h:23
virtual bool SetParameter(int32 Index, float NewParam) override
Definition LinearSpline.h:34
Definition AdvancedWidgetsModule.cpp:13
U16 Index
Definition radfft.cpp:71