Space Plunder
Loading...
Searching...
No Matches
RecoilData.h
Go to the documentation of this file.
1// Fill out your copyright notice in the Description page of Project Settings.
2
3#pragma once
4
5#include "CoreMinimal.h"
6#include "StoredData.h"
7#include "Curves/CurveVector.h"
8#include "RecoilData.generated.h"
9
10
11DECLARE_DELEGATE(FDoTransition);
12DECLARE_DELEGATE_RetVal(bool, FCheckCondition);
13
14
15UENUM(BlueprintType)
17{
18 Legacy UMETA(DisplayName="Legacy", ToolTip="Based on Lerp and SpringInterp"),
19 Advanced UMETA(DisplayName="Advanced", ToolTip="Based on curves")
20};
21
22UENUM(BlueprintType)
24{
25 Semi UMETA(DisplayName = "Semi"),
26 Auto UMETA(DisplayName = "Auto"),
27 Burst UMETA(DisplayName = "Burst"),
28};
29
31USTRUCT(BlueprintType)
33{
34 GENERATED_BODY()
35
36 UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category = "Advanced | Curve")
37 UCurveVector* SingleRot = nullptr;
38
39 UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category = "Advanced | Curve")
40 UCurveVector* SingleLoc = nullptr;
41
42 UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category = "Advanced | Curve")
43 UCurveVector* AutoRot = nullptr;
44
45 UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category = "Advanced | Curve")
46 UCurveVector* AutoLoc = nullptr;
47
48 UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category = "Advanced | Curve")
49 UCurveVector* RestRot = nullptr;
50
51 UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category = "Advanced | Curve")
52 UCurveVector* RestLoc = nullptr;
53
54 UPROPERTY(EditDefaultsOnly, BlueprintReadWrite, Category = "Common")
55 FString SlotName;
56
57 UPROPERTY(EditDefaultsOnly, BlueprintReadWrite, Category = "Common")
58 TEnumAsByte<ESolverType_PRAS> SolverType = Advanced;
59
60 UPROPERTY(EditDefaultsOnly, BlueprintReadWrite, Category = "Values")
61 UStoredData* StoredData = nullptr;
62};
63
65USTRUCT(BlueprintType)
67{
68 GENERATED_BODY()
69
70 UPROPERTY(VisibleAnywhere, BlueprintReadWrite, Category = "UI")
71 bool X = false;
72
73 UPROPERTY(VisibleAnywhere, BlueprintReadWrite, Category = "UI")
74 bool Y = false;
75
76 UPROPERTY(VisibleAnywhere, BlueprintReadWrite, Category = "UI")
77 bool Z = false;
78};
79
80USTRUCT()
82{
83 GENERATED_BODY()
84
85 FStartRest() = default;
86
87 FStartRest(bool X, bool Y, bool Z) : X(X), Y(Y), Z(Z)
88 {
89 }
90
91 bool X = false;
92 bool Y = false;
93 bool Z = false;
94};
95
96USTRUCT()
98{
99 GENERATED_BODY()
100
101
102 FCheckCondition TransitionCondition;
103
105 FDoTransition OnPlay;
106
108 FDoTransition OnStop;
109};
110
111USTRUCT(BlueprintType)
113{
114 GENERATED_BODY()
115
116 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "General")
117 FVector2D Pitch = FVector2D::UnitVector;
118 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "General")
119 FVector2D Kick = FVector2D::UnitVector;
120 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "General")
121 FVector2D KickR = FVector2D::UnitVector;
122 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "General")
123 FVector2D KickUp = FVector2D::UnitVector;
124
125 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "General")
126 FVector4 Yaw = FVector4(1, 1, 1, 1);
127 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "General")
128 FVector4 Roll = FVector4(1, 1, 1, 1);
129
130 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "General")
131 FVector2D Noise = FVector2D::UnitVector;
132
133 // X - Pitch, Y - Z offset
134 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "General")
135 FVector2D Progression = FVector2D::UnitVector;
136
137 FInputScale_PRAS operator* (const FInputScale_PRAS& A) const
138 {
139 FInputScale_PRAS NewScale;
140
141 NewScale.Pitch *= A.Pitch;
142 NewScale.Kick *= A.Kick;
143 NewScale.KickR *= A.KickR;
144 NewScale.KickUp *= A.KickUp;
145 NewScale.Yaw *= A.Yaw;
146 NewScale.Roll *= A.Roll;
147 NewScale.Noise *= A.Noise;
148 NewScale.Progression *= A.Progression;
149
150 return NewScale;
151 }
152
153 void operator*= (const FInputScale_PRAS& A)
154 {
155 Pitch *= A.Pitch;
156 Kick *= A.Kick;
157 KickR *= A.KickR;
158 KickUp *= A.KickUp;
159 Yaw *= A.Yaw;
160 Roll *= A.Roll;
161 Noise *= A.Noise;
162 Progression *= A.Progression;
163 }
164
165 FInputScale_PRAS operator/ (const FInputScale_PRAS& A) const
166 {
167 FInputScale_PRAS NewScale;
168
169 NewScale.Pitch /= A.Pitch;
170 NewScale.Kick /= A.Kick;
171 NewScale.KickR /= A.KickR;
172 NewScale.KickUp /= A.KickUp;
173 NewScale.Yaw /= A.Yaw;
174 NewScale.Roll /= A.Roll;
175 NewScale.Noise /= A.Noise;
176 NewScale.Progression /= A.Progression;
177
178 return NewScale;
179 }
180
181 void operator/= (const FInputScale_PRAS& A)
182 {
183 Pitch /= A.Pitch;
184 Kick /= A.Kick;
185 KickR /= A.KickR;
186 KickUp /= A.KickUp;
187 Yaw /= A.Yaw;
188 Roll /= A.Roll;
189 Noise /= A.Noise;
190 Progression /= A.Progression;
191 }
192
193 void Reset()
194 {
195 Pitch = Kick = KickR = KickUp = Noise = Progression = FVector2D::UnitVector;
196 Yaw = Roll = FVector4(1, 1, 1, 1);
197 }
198};
DECLARE_DELEGATE(FDoTransition)
EFireMode_PRAS
Definition RecoilData.h:24
@ UMETA
Definition RecoilData.h:18
ESolverType_PRAS
Definition RecoilData.h:17
DECLARE_DELEGATE_RetVal(bool, FCheckCondition)
Definition StoredData.h:26
Definition RecoilData.h:98
Definition RecoilData.h:113
FVector2D KickR
Definition RecoilData.h:121
FVector2D Noise
Definition RecoilData.h:131
FVector2D Pitch
Definition RecoilData.h:117
FVector2D KickUp
Definition RecoilData.h:123
FVector4 Yaw
Definition RecoilData.h:126
FVector2D Kick
Definition RecoilData.h:119
FVector4 Roll
Definition RecoilData.h:128
FVector2D Progression
Definition RecoilData.h:135
void Reset()
Definition RecoilData.h:193
Definition RecoilData.h:67
Definition RecoilData.h:33
Definition RecoilData.h:82