UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
ModuleInput.h
Go to the documentation of this file.
1// Copyright Epic Games, Inc. All Rights Reserved.
2
3#pragma once
4
5#include "CoreMinimal.h"
6//#include "Engine/NetSerialization.h"
8#include "ModuleInput.generated.h"
9
11
12#define UE_API CHAOSVEHICLESCORE_API
13
14UENUM(BlueprintType)
20
21UENUM(BlueprintType)
23{
24 MBoolean UMETA(DisplayName = "Digital (bool)"),
25 MAxis1D UMETA(DisplayName = "Axis1D (float)"),
26 MAxis2D UMETA(DisplayName = "Axis2D (Vector2D)"),
27 MAxis3D UMETA(DisplayName = "Axis3D (Vector)"),
28 MInteger UMETA(DisplayName = "Digital (int32)"),
29
30 // NOTE, If adding an entry here, add it to the end, otherwise existing assets get deserialized improperly.
31 // ALSO update the number of bits to serialize in FModuleInputValue::Serialize
32};
33
35UENUM(BlueprintType)
42
43UENUM(BlueprintType)
45{
46 // Replaces current value in buffer with new value
47 Override = 0,
48
49 // Adds new value to current value in buffer
51};
52
54{
55 template<int32 MaxValue, uint32 NumBits>
57 {
58 // NumBits = 8:
59 static constexpr int32 MaxBitValue = (1 << (NumBits - 1)) - 1; // 0111 1111 - Max abs value we will serialize
60 static constexpr int32 Bias = (1 << (NumBits - 1)); // 1000 0000 - Bias to pivot around (in order to support signed values)
61 static constexpr int32 SerIntMax = (1 << (NumBits - 0)); // 1 0000 0000 - What we pass into SerializeInt
62 static constexpr int32 MaxDelta = (1 << (NumBits - 0)) - 1; // 1111 1111 - Max delta is
63 };
64
65 template<int32 MaxValue, uint32 NumBits, typename T UE_REQUIRES(std::is_floating_point_v<T>&& NumBits < 32)>
66 bool ToCompressedFloat(const T InValue, uint32& OutCompressedFloat)
67 {
68 using Details = ModularQuantize::TCompressedFloatDetails<MaxValue, NumBits>;
69
70 bool clamp = false;
71 int64 ScaledValue;
72 if (MaxValue > Details::MaxBitValue)
73 {
74 // We have to scale this down
75 const T Scale = T(Details::MaxBitValue) / MaxValue;
76 ScaledValue = FMath::TruncToInt(Scale * InValue);
77 }
78 else
79 {
80 // We will scale up to get extra precision. But keep is a whole number preserve whole values
81 constexpr int32 Scale = Details::MaxBitValue / MaxValue;
82 ScaledValue = FMath::RoundToInt(Scale * InValue);
83 }
84
85 uint32 Delta = static_cast<uint32>(ScaledValue + Details::Bias);
86
87 if (Delta > Details::MaxDelta)
88 {
89 clamp = true;
90 Delta = static_cast<int32>(Delta) > 0 ? Details::MaxDelta : 0;
91 }
92
94
95 return !clamp;
96 }
97
98 template<int32 MaxValue, uint32 NumBits, typename T UE_REQUIRES(std::is_floating_point_v<T>&& NumBits < 32)>
99 bool FromCompressedFloat(const uint32 InCompressed, T& OutValue )
100 {
101 using Details = ModularQuantize::TCompressedFloatDetails<MaxValue, NumBits>;
102
103 uint32 Delta = InCompressed;
104 T UnscaledValue = static_cast<T>(static_cast<int32>(Delta) - Details::Bias);
105
106 if constexpr (MaxValue > Details::MaxBitValue)
107 {
108 // We have to scale down, scale needs to be a float:
109 constexpr T InvScale = MaxValue / (T)Details::MaxBitValue;
110 OutValue = UnscaledValue * InvScale;
111 }
112 else
113 {
114 constexpr int32 Scale = Details::MaxBitValue / MaxValue;
115 constexpr T InvScale = T(1) / (T)Scale;
116
117 OutValue = UnscaledValue * InvScale;
118 }
119
120 return true;
121 }
122
123 template<int32 MaxValue, uint32 NumBits, typename T UE_REQUIRES(std::is_floating_point_v<T>&& NumBits < 32)>
124 bool WriteCompressedFloat(const T Value, FArchive& Ar)
125 {
126 using Details = ModularQuantize::TCompressedFloatDetails<MaxValue, NumBits>;
127
128 uint32 CompressedValue;
129 bool clamp = ModularQuantize::ToCompressedFloat<MaxValue, NumBits>(Value, CompressedValue);
130
131 Ar.SerializeInt(CompressedValue, Details::SerIntMax);
132
133 return !clamp;
134 }
135
136 template<int32 MaxValue, uint32 NumBits, typename T UE_REQUIRES(std::is_floating_point_v<T>&& NumBits < 32)>
137 bool ReadCompressedFloat(T& Value, FArchive& Ar)
138 {
139 using Details = ModularQuantize::TCompressedFloatDetails<MaxValue, NumBits>;
140
141 uint32 CompressedValue;
142 Ar.SerializeInt(CompressedValue, Details::SerIntMax);
143
144 ModularQuantize::FromCompressedFloat<MaxValue, NumBits>(CompressedValue, Value);
145
146 return true;
147 }
148
149 // Required because we seialize quantized vector in seperate parts depending on input type
150 template<int32 MaxValue, uint32 NumBits>
152 {
153 if (Ar.IsSaving())
154 {
155 bool success = true;
156 success &= ModularQuantize::WriteCompressedFloat<MaxValue, NumBits>(InOutValue, Ar);
157 return success;
158 }
159
160 ModularQuantize::ReadCompressedFloat<MaxValue, NumBits>(InOutValue, Ar);
161 return true;
162 }
163
164 template<int32 MaxValue, uint32 NumBits, typename T UE_REQUIRES(std::is_floating_point_v<T>&& NumBits < 32)>
165 void QuantizeValue(T& Value)
166 {
167 uint32 CompressedValue = 0;
168 ModularQuantize::ToCompressedFloat<MaxValue, NumBits>(Value, CompressedValue);
169 ModularQuantize::FromCompressedFloat<MaxValue, NumBits>(CompressedValue, Value);
170 }
171
172 template<int32 MaxValue, uint32 NumBits, typename T UE_REQUIRES(std::is_floating_point_v<T>&& NumBits < 32)>
173 bool QuantizedIsNearlyEqual(const T& Left,const T& Right)
174 {
175 uint32 CompressedValue = 0;
176 T QuantLeft, QuantRight;
177 ModularQuantize::ToCompressedFloat<MaxValue, NumBits>(Left, CompressedValue);
178 ModularQuantize::FromCompressedFloat<MaxValue, NumBits>(CompressedValue, QuantLeft);
179 ModularQuantize::ToCompressedFloat<MaxValue, NumBits>(Right, CompressedValue);
180 ModularQuantize::FromCompressedFloat<MaxValue, NumBits>(CompressedValue, QuantRight);
181 return FMath::IsNearlyEqual(QuantLeft, QuantRight);
182 }
183}
184
185USTRUCT(BlueprintType)
186struct FModuleInputValue
187{
188 GENERATED_BODY()
189
190public:
191 using MAxis1D = double; // #TODO: Axis1D (float) double or float? FVector2D and FVector are double
192 using MAxis2D = FVector2D;
193 using MAxis3D = FVector;
194 using MInteger = int32;
195
196 // Support all relevant default constructors (FModuleInputValue isn't movable)
197 FModuleInputValue() = default;
198 FModuleInputValue(const FModuleInputValue&) = default;
199 FModuleInputValue& operator= (const FModuleInputValue&) = default;
200
201 // Specialized constructors for supported types
202 // Converting a value to a different type (e.g. Val = FVector(1, 1, 1); Val = true;) zeroes out any unused components to ensure getters continue to function correctly.
203 FModuleInputValue(bool bInValue) : Value(FVector::ZeroVector), ValueInt(bInValue), ValueType(EModuleInputValueType::MBoolean) {}
204 FModuleInputValue(MInteger InValue) : Value(FVector::ZeroVector), ValueInt(InValue), ValueType(EModuleInputValueType::MInteger) {}
205 FModuleInputValue(MAxis1D InValue) : Value(InValue, 0.f, 0.f), ValueInt(0), ValueType(EModuleInputValueType::MAxis1D) {}
206 FModuleInputValue(MAxis2D InValue) : Value(InValue.X, InValue.Y, 0.f), ValueInt(0), ValueType(EModuleInputValueType::MAxis2D) {}
207 FModuleInputValue(MAxis3D InValue) : Value(InValue), ValueInt(0), ValueType(EModuleInputValueType::MAxis3D) {}
208
209 FModuleInputValue ReturnQuantized(EModuleInputQuantizationType InInputQuantizationType) const;
210
211 static void Quantize(double& InOutValue, EModuleInputQuantizationType InInputQuantizationType);
212
213 static bool SerializeQuantized(double& InOutValue, FArchive& Ar, EModuleInputQuantizationType InInputQuantizationType);
214
215 // Build a specific type with an arbitrary Axis3D value
216 FModuleInputValue(EModuleInputValueType InValueType, MAxis3D InValue) : Value(InValue), ValueType(InValueType)
217 {
218 ValueInt = 0.0f; // not used in this case
219
220 // Clear out value components to match type
221 switch (ValueType)
222 {
223 case EModuleInputValueType::MBoolean:
224 case EModuleInputValueType::MAxis1D:
225 Value.Y = 0.f;
226 //[[fallthrough]];
227 case EModuleInputValueType::MAxis2D:
228 Value.Z = 0.f;
229 //[[fallthrough]];
230 case EModuleInputValueType::MAxis3D:
231 default:
232 return;
233 }
234 }
235
236 // Build a specific type with an Integer value
237 FModuleInputValue(EModuleInputValueType InValueType, MInteger InValue) : ValueInt(InValue), ValueType(InValueType)
238 {
239 // not used in thos case clear for good measure
240 Value.X = 0.f;
241 Value.Y = 0.f;
242 Value.Z = 0.f;
243 }
244
245 // Resets Value without affecting ValueType
246 void Reset()
247 {
248 Value = FVector::ZeroVector;
249 ValueInt = 0;
250 }
251
252 FModuleInputValue& operator+=(const FModuleInputValue& Rhs)
253 {
254 ensure(ValueType == Rhs.ValueType);
255
256 Value += Rhs.Value;
257 // Promote value type to largest number of bits.
258 ValueType = FMath::Max(ValueType, Rhs.ValueType);
259 return *this;
260 }
261
262 friend FModuleInputValue operator+(const FModuleInputValue& Lhs, const FModuleInputValue& Rhs)
263 {
264 ensure(Lhs.ValueType == Rhs.ValueType);
265
266 FModuleInputValue Result(Lhs);
267 Result += Rhs;
268 return Result;
269 }
270
271 FModuleInputValue& operator-=(const FModuleInputValue& Rhs)
272 {
273 ensure(ValueType == Rhs.ValueType);
274
275 Value -= Rhs.Value;
276 // Promote value type to largest number of bits.
277 ValueType = FMath::Max(ValueType, Rhs.ValueType);
278 return *this;
279 }
280
281 friend FModuleInputValue operator-(const FModuleInputValue& Lhs, const FModuleInputValue& Rhs)
282 {
283 ensure(Lhs.ValueType == Rhs.ValueType);
284
285 FModuleInputValue Result(Lhs);
286 Result -= Rhs;
287 return Result;
288 }
289
290 // Scalar operators
291 FModuleInputValue& operator*=(float Scalar)
292 {
293 ensure(ValueType != EModuleInputValueType::MBoolean);
294 ensure(ValueType != EModuleInputValueType::MInteger);
295
296 Value *= Scalar;
297 return *this;
298 }
299
300 friend FModuleInputValue operator*(const FModuleInputValue& Lhs, const float Rhs)
301 {
302 ensure(Lhs.GetValueType() != EModuleInputValueType::MBoolean);
303 ensure(Lhs.GetValueType() != EModuleInputValueType::MInteger);
304
305 FModuleInputValue Result(Lhs);
306 Result *= Rhs;
307 return Result;
308 }
309
310 static FModuleInputValue Clamp(const FModuleInputValue& InValue, const float InMin, const float InMax)
311 {
312 FModuleInputValue OutValue = InValue;
313 float Mag = InValue.GetMagnitude();
314
315 if (Mag < InMin)
316 {
317 OutValue.SetMagnitude(InMin);
318 }
319 else if (Mag > InMax)
320 {
321 OutValue.SetMagnitude(InMax);
322 }
323
324 return OutValue;
325 }
326
327
328 template<typename T>
329 inline T Get() const { static_assert(sizeof(T) == 0, "Unsupported conversion for type"); }
330
331 // Read only index based value accessor, doesn't care about type. Expect 0 when accessing unused components.
332 float operator[](int32 Index) const { return Value[Index]; }
333
334 bool IsQuantizedNonZero(EModuleInputQuantizationType InInputQuantizationType, float Tolerance = KINDA_SMALL_NUMBER) const { return ReturnQuantized(InInputQuantizationType).IsNonZero(Tolerance); }
335 UE_API bool IsNonZero(float Tolerance = KINDA_SMALL_NUMBER) const;
336
337 // In-place type conversion
339 {
340 if (ValueType != Type)
341 {
342 *this = FModuleInputValue(Type, Value);
343 }
344 return *this;
345 }
347
348 EModuleInputValueType GetValueType() const { return ValueType; }
349
350 UE_API float GetMagnitudeSq() const;
351 UE_API float GetMagnitude() const;
352 UE_API int32 GetMagnitudeInt() const;
353
354 // Serialize values
356 UE_API void NetSerialize(FArchive& Ar, UPackageMap* Map, bool& bOutSuccess, EModuleInputQuantizationType InInputQuantizationType);
358
359 UE_API void Set(const FModuleInputValue& In);
360
361 UE_API void Lerp(const FModuleInputValue& Min, const FModuleInputValue& Max, float Alpha);
362
363 UE_API void Merge(const FModuleInputValue& From);
364
365 UE_API void Combine(const FModuleInputValue& With);
366
367 UE_API void Decay(const float DecayAmount);
368
369 // Type sensitive debug stringify
370 UE_API FString ToString() const;
371
373 void SetApplyInputDecay(const bool bInApplyInputDecay) { bApplyInputDecay = bInApplyInputDecay; }
374 bool ShouldApplyInputDecay() const { return bApplyInputDecay; }
375
377 void SetClearAfterConsumed(const bool bInClearAfterConsumed) { bClearAfterConsumed = bInClearAfterConsumed; }
378 bool ShouldClearAfterConsumed() const { return bClearAfterConsumed; }
379
380protected:
381 void SetMagnitude(float NewSize);
382
383 UPROPERTY()
384 FVector Value = FVector::ZeroVector;
385
386 UPROPERTY()
387 int32 ValueInt = 0;
388
389 UPROPERTY()
391
392 UPROPERTY()
393 bool bApplyInputDecay = false;
394
395 UPROPERTY()
396 bool bClearAfterConsumed = false;
397
398};
399
400// Supported getter specializations
401template<>
402inline bool FModuleInputValue::Get() const
403{
404 // True if any component is non-zero
405 return IsNonZero();
406}
407
408template<>
410{
411 return Value.X;
412}
413
414template<>
419
420template<>
422{
423 return Value;
424}
425
426template<>
431
432
434{
435public:
436
438 {
439 ensure(InValue.GetValueType() == EModuleInputValueType::MBoolean);
440 return InValue.Get<bool>();
441 }
442
444 {
445 ensure(InValue.GetValueType() == EModuleInputValueType::MAxis1D);
446 return static_cast<float>(InValue.Get<FModuleInputValue::MAxis1D>());
447 }
448
450 {
451 ensure(InValue.GetValueType() == EModuleInputValueType::MAxis2D);
453 }
454
456 {
457 ensure(InValue.GetValueType() == EModuleInputValueType::MAxis3D);
459 }
460
462 {
463 ensure(InValue.GetValueType() == EModuleInputValueType::MInteger);
465 }
466
468 {
469 return ActionValue.ToString();
470 }
471};
472
473
474UCLASS(BlueprintType, Blueprintable, MinimalAPI)
476{
478
479public:
481 : Super(ObjectInitializer)
482 , RiseRate(5.0f), FallRate(5.0f), InputCurveFunction(EFunctionType::LinearFunction) { }
483
487
491 UPROPERTY(EditAnywhere, Category = VehicleInputRate)
492 float RiseRate;
493
497 UPROPERTY(EditAnywhere, Category = VehicleInputRate)
498 float FallRate;
499
503 UPROPERTY(EditAnywhere, Category = VehicleInputRate)
504 EFunctionType InputCurveFunction;
505
510 //UPROPERTY(EditAnywhere, Category = VehicleInputRate) #TODO: Reinstate?
511 //FRuntimeFloatCurve UserCurve;
512
514 UE_API virtual FModuleInputValue InterpInputValue(float DeltaTime, const FModuleInputValue& CurrentValue, const FModuleInputValue& NewValue) const;
515 UE_API virtual float CalcControlFunction(float InputValue);
516};
517
518USTRUCT(BlueprintType)
520{
522
524 {
525 Type = EModuleInputValueType::MBoolean;
526 bApplyInputDecay = false;
527 bClearAfterConsumed = false;
528 }
529
531 : Name(InName)
532 , Type(InType)
533 , bApplyInputDecay(false)
534 , bClearAfterConsumed(false)
535 {
536 }
537
538 bool operator==(const FModuleInputSetup& Rhs) const
539 {
540 return (Name == Rhs.Name);
541 }
542
543 UPROPERTY(EditAnywhere, Category = VehicleInput)
545
546 UPROPERTY(EditAnywhere, Category = VehicleInput)
548
550 UPROPERTY(EditAnywhere, Category = VehicleInput)
551 bool bApplyInputDecay;
552
554 UPROPERTY(EditAnywhere, Category = VehicleInput)
555 bool bClearAfterConsumed;
556};
557
559{
560public:
565
567 {
568 InitSetupData = nullptr;
569 }
570
571 static bool HasSetup() { return InitSetupData != nullptr; }
572 static TArray<struct FModuleInputSetup>* GetSetup() { return InitSetupData; }
573
574private:
575
576 static UE_API TArray<struct FModuleInputSetup>* InitSetupData;
577};
578
579
580USTRUCT()
582{
584
585public:
588
597
598 int GetNumInputs() const { return InputValues.Num(); }
599
600 FModuleInputValue GetValueAtIndex(int Index) const { return InputValues[Index]; }
601
603 {
604 if (Quantize)
605 {
606 InputValues[Index].Set(InValue.ReturnQuantized(InInputQuantizationType));
607 }
608 else
609 {
610 InputValues[Index].Set(InValue);
611 }
612 }
613
618
623
625 {
626 if (&Other != this)
627 {
628 InputValues.Reset();
629 // perform a deep copy
630 if (Other.InputValues.Num())
631 {
632 InputValues = Other.InputValues;
633 }
634 }
635 return *this;
636 }
637
638 UE_API void Initialize(TArray<FModuleInputSetup>& SetupData, FInputNameMap& NameMapOut);
639
640 UE_API void ZeroValues();
641
643
644 UE_API int AddInput(EModuleInputValueType Type);
645
646 UE_API void RemoveAllInputs();
647
649
650 UE_API void Merge(const FModuleInputContainer& From);
651
652 UE_API void Combine(const FModuleInputContainer& With);
653
655 UE_API void Decay(const float DecayAmount);
656
658 UE_API void ClearConsumedInputs();
659
661
662private:
663 UPROPERTY()
664 TArray<FModuleInputValue> InputValues;
665
666};
667
668
670{
671public:
672
674
681
682 UE_API void SetValue(const FName& InName, const FModuleInputValue& InValue, bool Quantize = true);
683 UE_API void CombineValue(const FName& InName, const FModuleInputValue& InValue);
684 UE_API void MergeValue(const FName& InName, const FModuleInputValue& InValue);
685 UE_API FModuleInputValue GetValue(const FName& InName) const;
686 UE_API EModuleInputValueType GetValueType(const FName& InName) const;
687 UE_API float GetMagnitude(const FName& InName) const;
688 UE_API int32 GetMagnitudeInt(const FName& InName) const;
689 UE_API bool InputsNonZero() const;
690
691 // Quick Access to data type
692 bool GetBool(const FName& InName) const
693 {
694 FModuleInputValue Value = GetValue(InName);
696 }
697 int32 GetInteger(const FName& InName) const
698 {
699 FModuleInputValue Value = GetValue(InName);
701 }
702 double GetFloat(const FName& InName) const
703 {
704 FModuleInputValue Value = GetValue(InName);
706 }
707 FVector2D GetVector2D(const FName& InName) const
708 {
709 FModuleInputValue Value = GetValue(InName);
711 }
712 FVector GetVector(const FName& InName) const
713 {
714 FModuleInputValue Value = GetValue(InName);
716 }
717
718 void SetBool(const FName& InName, bool InBool)
719 {
720 ensure(GetValueType(InName) == EModuleInputValueType::MBoolean);
721 FModuleInputValue Value(EModuleInputValueType::MBoolean, InBool);
722 SetValue(InName, Value);
723 }
724 void SetInteger(const FName& InName, int32 InInteger)
725 {
726 ensure(GetValueType(InName) == EModuleInputValueType::MInteger);
728 SetValue(InName, Value);
729 }
730 void SetFloat(const FName& InName, double InFloat, bool Quantize = false)
731 {
732 ensure(GetValueType(InName) == EModuleInputValueType::MAxis1D);
734 SetValue(InName, Value, Quantize);
735 }
736 void SetVector2D(const FName& InName, const FVector2D& InVector2D, bool Quantize = false)
737 {
738 ensure(GetValueType(InName) == EModuleInputValueType::MAxis2D);
739 SetValue(InName, FModuleInputValue(InVector2D), Quantize);
740 }
741 void SetVector(const FName& InName, const FVector& InVector, bool Quantize = false)
742 {
743 ensure(GetValueType(InName) == EModuleInputValueType::MAxis3D);
744 SetValue(InName, FModuleInputValue(InVector), Quantize);
745 }
746
747
748 const FInputNameMap& NameMap; // per vehicle
749 FModuleInputContainer& ValueContainer; // per vehicle instance
751};
752
753UCLASS(Abstract, BlueprintType, Blueprintable, EditInlineNew, MinimalAPI)
781
782#undef UE_API
783
#define ensure( InExpression)
Definition AssertionMacros.h:464
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
#define DECLARE_LOG_CATEGORY_EXTERN(CategoryName, DefaultVerbosity, CompileTimeVerbosity)
Definition LogMacros.h:361
EModuleInputQuantizationType
Definition ModuleInput.h:16
EModuleInputValueType
Definition ModuleInput.h:23
#define UE_API
Definition ModuleInput.h:12
EFunctionType
Definition ModuleInput.h:37
EModuleInputBufferActionType
Definition ModuleInput.h:45
#define UPROPERTY(...)
UObject definition macros.
Definition ObjectMacros.h:744
#define GENERATED_BODY(...)
Definition ObjectMacros.h:765
#define UCLASS(...)
Definition ObjectMacros.h:776
#define UENUM(...)
Definition ObjectMacros.h:749
#define USTRUCT(...)
Definition ObjectMacros.h:746
USkinnedMeshComponent float
Definition SkinnedMeshComponent.h:60
#define KINDA_SMALL_NUMBER
Definition UnrealMathUtility.h:67
uint8_t uint8
Definition binka_ue_file_header.h:8
uint32_t uint32
Definition binka_ue_file_header.h:6
Definition Archive.h:1208
UE_FORCEINLINE_HINT bool IsSaving() const
Definition Archive.h:248
Definition ModuleInput.h:670
void SetVector(const FName &InName, const FVector &InVector, bool Quantize=false)
Definition ModuleInput.h:741
double GetFloat(const FName &InName) const
Definition ModuleInput.h:702
FInputInterface(const FInputNameMap &InNameMap, FModuleInputContainer &InValueContainer, EModuleInputQuantizationType InInputQuantizationType)
Definition ModuleInput.h:675
const FInputNameMap & NameMap
Definition ModuleInput.h:748
void SetInteger(const FName &InName, int32 InInteger)
Definition ModuleInput.h:724
void SetVector2D(const FName &InName, const FVector2D &InVector2D, bool Quantize=false)
Definition ModuleInput.h:736
void SetBool(const FName &InName, bool InBool)
Definition ModuleInput.h:718
EModuleInputQuantizationType InputQuantizationType
Definition ModuleInput.h:750
int32 GetInteger(const FName &InName) const
Definition ModuleInput.h:697
FVector GetVector(const FName &InName) const
Definition ModuleInput.h:712
void SetFloat(const FName &InName, double InFloat, bool Quantize=false)
Definition ModuleInput.h:730
FModuleInputContainer & ValueContainer
Definition ModuleInput.h:749
FVector2D GetVector2D(const FName &InName) const
Definition ModuleInput.h:707
bool GetBool(const FName &InName) const
Definition ModuleInput.h:692
Definition ModuleInput.h:434
static FVector ToAxis3D(FModuleInputValue &InValue)
Definition ModuleInput.h:455
static bool ToBool(FModuleInputValue &InValue)
Definition ModuleInput.h:437
static FString ToString(FModuleInputValue &ActionValue)
Definition ModuleInput.h:467
static float ToAxis1D(FModuleInputValue &InValue)
Definition ModuleInput.h:443
static int32 ToInteger(FModuleInputValue &InValue)
Definition ModuleInput.h:461
static FVector2D ToAxis2D(FModuleInputValue &InValue)
Definition ModuleInput.h:449
Definition NameTypes.h:617
Definition UObjectGlobals.h:1292
Definition ModuleInput.h:559
~FScopedModuleInputInitializer()
Definition ModuleInput.h:566
static TArray< struct FModuleInputSetup > * GetSetup()
Definition ModuleInput.h:572
FScopedModuleInputInitializer(TArray< struct FModuleInputSetup > &InSetupData)
Definition ModuleInput.h:561
static bool HasSetup()
Definition ModuleInput.h:571
Definition Array.h:670
Definition UnrealString.h.inl:34
Definition ModuleInput.h:476
virtual ~UDefaultModularVehicleInputModifier()
Definition ModuleInput.h:484
UDefaultModularVehicleInputModifier(const class FObjectInitializer &ObjectInitializer)
Definition ModuleInput.h:480
Definition Object.h:95
Definition CoreNet.h:191
Definition ModuleInput.h:755
virtual void BufferInput(const FInputNameMap &InNameMap, const FName InName, const FModuleInputValue &InValue, EModuleInputBufferActionType BufferAction=EModuleInputBufferActionType::Override)
Definition ModuleInput.h:768
virtual bool IsLoopingTestInputBuffer()
Definition ModuleInput.h:777
virtual void InitializeContainer(TArray< FModuleInputSetup > &SetupData, FInputNameMap &NameMapOut, EModuleInputQuantizationType InInputQuantizationType)
Definition ModuleInput.h:762
virtual void ProduceInput(int32 PhysicsStep, int32 NumSteps, const FInputNameMap &InNameMap, FModuleInputContainer &InOutContainer)
Definition ModuleInput.h:771
virtual TArray< FModuleInputContainer > * GetTestInputBuffer()
Definition ModuleInput.h:774
EModuleInputQuantizationType InputQuantizationType
Definition ModuleInput.h:779
Definition ModuleInput.h:54
bool SerializeFixedFloat(double &InOutValue, FArchive &Ar)
Definition ModuleInput.h:151
@ false
Definition radaudio_common.h:23
U16 Index
Definition radfft.cpp:71
Definition ModuleInput.h:582
void MergeValueAtIndex(int Index, const FModuleInputValue &InValue, EModuleInputQuantizationType InInputQuantizationType)
Definition ModuleInput.h:614
TArray< FModuleInputValue > & AccessInputValues()
Definition ModuleInput.h:660
FModuleInputContainer & operator=(const FModuleInputContainer &Other)
Definition ModuleInput.h:624
int GetNumInputs() const
Definition ModuleInput.h:598
void SetValueAtIndex(int Index, const FModuleInputValue &InValue, EModuleInputQuantizationType InInputQuantizationType, bool Quantize=true)
Definition ModuleInput.h:602
FModuleInputValue GetValueAtIndex(int Index) const
Definition ModuleInput.h:600
void CombineValueAtIndex(int Index, const FModuleInputValue &InValue, EModuleInputQuantizationType InInputQuantizationType)
Definition ModuleInput.h:619
FModuleInputContainer()
Definition ModuleInput.h:589
Definition ModuleInput.h:520
bool operator==(const FModuleInputSetup &Rhs) const
Definition ModuleInput.h:538
FModuleInputSetup(const FName &InName, const EModuleInputValueType &InType)
Definition ModuleInput.h:530
Definition ModuleInput.h:187
T Get() const
Definition ModuleInput.h:329
bool ShouldApplyInputDecay() const
Definition ModuleInput.h:374
bool ShouldClearAfterConsumed() const
Definition ModuleInput.h:378
FVector2D MAxis2D
Definition ModuleInput.h:192
FModuleInputValue & ConvertToType(const FModuleInputValue &Other)
Definition ModuleInput.h:346
bool IsQuantizedNonZero(EModuleInputQuantizationType InInputQuantizationType, float Tolerance=KINDA_SMALL_NUMBER) const
Definition ModuleInput.h:334
int32 MInteger
Definition ModuleInput.h:194
FModuleInputValue & ConvertToType(EModuleInputValueType Type)
Definition ModuleInput.h:338
float operator[](int32 Index) const
Definition ModuleInput.h:332
void SetApplyInputDecay(const bool bInApplyInputDecay)
Definition ModuleInput.h:373
FVector Value
Definition ModuleInput.h:384
double MAxis1D
Definition ModuleInput.h:191
void SetClearAfterConsumed(const bool bInClearAfterConsumed)
Definition ModuleInput.h:377
int32 ValueInt
Definition ModuleInput.h:387
EModuleInputValueType GetValueType() const
Definition ModuleInput.h:348
Definition ModuleInput.h:57
static constexpr int32 Bias
Definition ModuleInput.h:60
static constexpr int32 MaxBitValue
Definition ModuleInput.h:59
static constexpr int32 MaxDelta
Definition ModuleInput.h:62
static constexpr int32 SerIntMax
Definition ModuleInput.h:61
T Y
Definition Vector.h:65
T X
Definition Vector.h:62