UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
ForceFeedbackEffect.h
Go to the documentation of this file.
1// Copyright Epic Games, Inc. All Rights Reserved.
2#pragma once
3
4#include "CoreMinimal.h"
6#include "UObject/Object.h"
7#include "Curves/CurveFloat.h"
10#include "ForceFeedbackEffect.generated.h"
11
15
16USTRUCT()
18{
20
21
22 UPROPERTY(EditAnywhere, Category="ChannelDetails")
23 uint32 bAffectsLeftLarge:1;
24
26 UPROPERTY(EditAnywhere, Category="ChannelDetails")
27 uint32 bAffectsLeftSmall:1;
28
30 UPROPERTY(EditAnywhere, Category="ChannelDetails")
31 uint32 bAffectsRightLarge:1;
32
34 UPROPERTY(EditAnywhere, Category="ChannelDetails")
35 uint32 bAffectsRightSmall:1;
36
37 UPROPERTY(EditAnywhere, Category="ChannelDetails")
39
41 : bAffectsLeftLarge(true)
42 , bAffectsLeftSmall(true)
43 , bAffectsRightLarge(true)
44 , bAffectsRightSmall(true)
45 {
46 }
47};
48
49USTRUCT()
51{
53
54 UPROPERTY()
55 TObjectPtr<class UForceFeedbackEffect> ForceFeedbackEffect;
56
58 float PlayTime;
59
62
64 bool bActivatedDeviceProperties;
65
67 UPROPERTY()
68 TSet<FInputDevicePropertyHandle> ActiveDeviceProperties;
69
71 : ForceFeedbackEffect(nullptr)
72 , PlayTime(0.f)
73 , PlatformUser(PLATFORMUSERID_NONE)
74 , bActivatedDeviceProperties(false)
75 {
76 }
77
79 : ForceFeedbackEffect(InEffect)
80 , Parameters(InParameters)
81 , PlayTime(0.f)
82 , PlatformUser(InPlatformUser)
83 , bActivatedDeviceProperties(false)
84 {
85 }
86
88
89 // Updates the final force feedback values based on this effect. Returns true if the effect should continue playing, false if it is finished.
90 ENGINE_API bool Update(float DeltaTime, FForceFeedbackValues& Values);
91
92 // Activates all the device properties with the input device subsystem
93 ENGINE_API void ActivateDeviceProperties();
94
96 ENGINE_API void ResetDeviceProperties();
97
98 // Gets the current values at the stored play time
99 ENGINE_API void GetValues(FForceFeedbackValues& Values) const;
100};
101
103USTRUCT()
105{
107
109
110 UPROPERTY(EditAnywhere, Category="ForceFeedbackEffect")
112};
113
117UCLASS(BlueprintType, MinimalAPI)
119{
121
122 UPROPERTY(EditAnywhere, Category="ForceFeedbackEffect")
124
126 UPROPERTY(EditAnywhere, Category = "ForceFeedbackEffect", Meta = (GetOptions = "Engine.InputPlatformSettings.GetAllHardwareDeviceNames"))
128
130 UPROPERTY(EditAnywhere, Instanced, Category = "ForceFeedbackEffect")
132
134 UPROPERTY(Category=Info, AssetRegistrySearchable, VisibleAnywhere, BlueprintReadOnly)
135 float Duration;
136
137#if WITH_EDITOR
138 virtual void PostEditChangeChainProperty( struct FPropertyChangedChainEvent& PropertyChangedEvent) override;
139#endif
140
141 float GetDuration();
142
144 float GetTotalDevicePropertyDuration();
145
146 void GetValues(const float EvalTime, FForceFeedbackValues& Values, const FPlatformUserId PlatformUser, float ValueMultiplier = 1.f) const;
147
153 const TArray<FForceFeedbackChannelDetails>& GetCurrentChannelDetails(const FPlatformUserId PlatformUser) const;
154};
constexpr FPlatformUserId PLATFORMUSERID_NONE
Definition CoreMiscDefines.h:516
UE_FORCEINLINE_HINT TSharedRef< CastToType, Mode > StaticCastSharedRef(TSharedRef< CastFromType, Mode > const &InSharedRef)
Definition SharedPointer.h:127
return true
Definition ExternalRpcRegistry.cpp:601
#define UPROPERTY(...)
UObject definition macros.
Definition ObjectMacros.h:744
#define GENERATED_BODY(...)
Definition ObjectMacros.h:765
#define GENERATED_UCLASS_BODY(...)
Definition ObjectMacros.h:768
#define UCLASS(...)
Definition ObjectMacros.h:776
#define USTRUCT(...)
Definition ObjectMacros.h:746
#define GENERATED_USTRUCT_BODY(...)
Definition ObjectMacros.h:767
uint32_t uint32
Definition binka_ue_file_header.h:6
Definition Array.h:670
Definition UnrealString.h.inl:34
Definition ForceFeedbackEffect.h:119
Definition InputDeviceProperties.h:33
ENGINE_API float GetDuration() const
Definition InputDeviceProperties.cpp:42
Definition Object.h:95
@ false
Definition radaudio_common.h:23
Definition ForceFeedbackEffect.h:51
FActiveForceFeedbackEffect(UForceFeedbackEffect *InEffect, FForceFeedbackParameters InParameters, FPlatformUserId InPlatformUser)
Definition ForceFeedbackEffect.h:78
Definition ForceFeedbackEffect.h:18
Definition ForceFeedbackEffect.h:105
Definition ForceFeedbackParameters.h:9
Definition IInputInterface.h:26
Definition InputDevicePropertyHandle.h:10
Definition CoreMiscDefines.h:470
Definition UnrealType.h:7001
Definition CurveFloat.h:13
Definition ObjectPtr.h:488