DayZ 1.24
Loading...
Searching...
No Matches
Easing Class Reference

Input value between 0 and 1, returns value adjusted by easing, no automatic clamping of input(do your own !!) More...

Static Private Member Functions

static float EaseInSine (float t)
 
static float EaseOutSine (float t)
 
static float EaseInOutSine (float t)
 
static float EaseInQuad (float t)
 
static float EaseOutQuad (float t)
 
static float EaseInOutQuad (float t)
 
static float EaseInCubic (float t)
 
static float EaseOutCubic (float t)
 
static float EaseInOutCubic (float t)
 
static float EaseInQuart (float t)
 
static float EaseOutQuart (float t)
 
static float EaseInOutQuart (float t)
 
static float EaseInQuint (float t)
 
static float EaseOutQuint (float t)
 
static float EaseInOutQuint (float t)
 
static float EaseInExpo (float t)
 
static float EaseOutExpo (float t)
 
static float EaseInOutExpo (float t)
 
static float EaseInCirc (float t)
 
static float EaseOutCirc (float t)
 
static float EaseInOutCirc (float t)
 
static float EaseInBack (float t, float magnitude=1.70158)
 
static float EaseOutBack (float t, float magnitude=1.70158)
 
static float EaseInOutBack (float t, float magnitude=1.70158)
 
static float EaseInElastic (float t, float magnitude=0.7)
 
static float EaseOutElastic (float t, float magnitude=0.7)
 
static float EaseInOutElastic (float t, float magnitude=0.65)
 
static float EaseOutBounce (float t)
 
static float EaseInBounce (float t)
 
static float EaseInOutBounce (float t)
 

Detailed Description

Input value between 0 and 1, returns value adjusted by easing, no automatic clamping of input(do your own !!)

Definition at line 2 of file Easing.c.

Member Function Documentation

◆ EaseInBack()

static float Easing::EaseInBack ( float t,
float magnitude = 1.70158 )
inlinestaticprivate

Definition at line 155 of file Easing.c.

156 {
157 return t * t * ((magnitude + 1) * t - magnitude);
158 }

◆ EaseInBounce()

static float Easing::EaseInBounce ( float t)
inlinestaticprivate

Definition at line 256 of file Easing.c.

257 {
258 return 1 - EaseOutBounce(1 - t);
259 }
static float EaseOutBounce(float t)
Definition Easing.c:224

References EaseOutBounce().

Referenced by EaseInOutBounce().

◆ EaseInCirc()

static float Easing::EaseInCirc ( float t)
inlinestaticprivate

Definition at line 131 of file Easing.c.

132 {
133 float scaledTime = t / 1;
134 return -1 * (Math.Sqrt(1 - scaledTime * t) - 1);
135 }
Definition EnMath.c:7
static proto float Sqrt(float val)
Returns square root.

References Math::Sqrt().

Referenced by PoisoningMdfr::OnTick().

◆ EaseInCubic()

static float Easing::EaseInCubic ( float t)
inlinestaticprivate

Definition at line 37 of file Easing.c.

38 {
39 return t * t * t;
40 }

Referenced by PPERequester_GameplayBase::OnStart().

◆ EaseInElastic()

static float Easing::EaseInElastic ( float t,
float magnitude = 0.7 )
inlinestaticprivate

Definition at line 180 of file Easing.c.

181 {
182 if (t == 0 || t == 1)
183 return t;
184
185 float scaledTime = t / 1;
186 float scaledTime1 = scaledTime - 1;
187
188 float p = 1 - magnitude;
189 float s = p / (2 * Math.PI) * Math.Asin(1);
190
191 return -(Math.Pow(2, 10 * scaledTime1) * Math.Sin((scaledTime1 - s) * (2 * Math.PI) / p));
192 }
static proto float Asin(float s)
Returns angle in radians from sinus.
static proto float Sin(float angle)
Returns sinus of angle in radians.
static proto float Pow(float v, float power)
Return power of v ^ power.
static const float PI
Definition EnMath.c:12

References Math::Asin(), Math::PI, Math::Pow(), and Math::Sin().

◆ EaseInExpo()

static float Easing::EaseInExpo ( float t)
inlinestaticprivate

Definition at line 99 of file Easing.c.

100 {
101 if (t == 0)
102 return 0;
103
104 return Math.Pow(2, 10 * (t - 1));
105 }

References Math::Pow().

Referenced by PPERequester_GameplayBase::OnUpdate().

◆ EaseInOutBack()

static float Easing::EaseInOutBack ( float t,
float magnitude = 1.70158 )
inlinestaticprivate

Definition at line 166 of file Easing.c.

167 {
168
169 float scaledTime = t * 2;
170 float scaledTime2 = scaledTime - 2;
171
172 float s = magnitude * 1.525;
173
174 if (scaledTime < 1)
175 return 0.5 * scaledTime * scaledTime * (((s + 1) * scaledTime) - s);
176
177 return 0.5 * (scaledTime2 * scaledTime2 * ((s + 1) * scaledTime2 + s) + 2);
178 }

◆ EaseInOutBounce()

static float Easing::EaseInOutBounce ( float t)
inlinestaticprivate

Definition at line 261 of file Easing.c.

262 {
263 if (t < 0.5)
264 return EaseInBounce(t * 2) * 0.5;
265 return (EaseOutBounce((t * 2) - 1) * 0.5) + 0.5;
266 }
static float EaseInBounce(float t)
Definition Easing.c:256

References EaseInBounce(), and EaseOutBounce().

◆ EaseInOutCirc()

static float Easing::EaseInOutCirc ( float t)
inlinestaticprivate

Definition at line 143 of file Easing.c.

144 {
145
146 float scaledTime = t * 2;
147 float scaledTime1 = scaledTime - 2;
148
149 if (scaledTime < 1)
150 return -0.5 * (Math.Sqrt(1 - scaledTime * scaledTime) - 1);
151
152 return 0.5 * (Math.Sqrt(1 - scaledTime1 * scaledTime1) + 1);
153 }

References Math::Sqrt().

◆ EaseInOutCubic()

static float Easing::EaseInOutCubic ( float t)
inlinestaticprivate

Definition at line 48 of file Easing.c.

49 {
50 if (t < 0.5)
51 return 4 * t * t * t;
52 else
53 return (t - 1) * (2 * t - 2) * (2 * t - 2) + 1;
54 }

◆ EaseInOutElastic()

static float Easing::EaseInOutElastic ( float t,
float magnitude = 0.65 )
inlinestaticprivate

Definition at line 206 of file Easing.c.

207 {
208 float p = 1 - magnitude;
209
210 if (t == 0 || t == 1)
211 return t;
212
213 float scaledTime = t * 2;
214 float scaledTime1 = scaledTime - 1;
215
216 float s = p / (2 * Math.PI) * Math.Asin(1);
217
218 if (scaledTime < 1)
219 return -0.5 * (Math.Pow(2, 10 * scaledTime1) * Math.Sin((scaledTime1 - s) * (2 * Math.PI) / p));
220
221 return (Math.Pow(2, -10 * scaledTime1) * Math.Sin((scaledTime1 - s) * (2 * Math.PI) / p) * 0.5) + 1;
222 }

References Math::Asin(), Math::PI, Math::Pow(), and Math::Sin().

◆ EaseInOutExpo()

static float Easing::EaseInOutExpo ( float t)
inlinestaticprivate

Definition at line 115 of file Easing.c.

116 {
117
118 if (t == 0 || t == 1)
119 return t;
120
121 float scaledTime = t * 2;
122 float scaledTime1 = scaledTime - 1;
123
124 if (scaledTime < 1)
125 return 0.5 * Math.Pow(2, 10 * scaledTime1);
126
127 return 0.5 * (-Math.Pow(2, -10 * scaledTime1) + 2);
128
129 }

References Math::Pow().

◆ EaseInOutQuad()

static float Easing::EaseInOutQuad ( float t)
inlinestaticprivate

Definition at line 29 of file Easing.c.

30 {
31 if (t < 0.5)
32 return 2 * t * t;
33 else
34 return -1 + (4 - 2 * t) * t;
35 }

◆ EaseInOutQuart()

static float Easing::EaseInOutQuart ( float t)
inlinestaticprivate

Definition at line 68 of file Easing.c.

69 {
70 float t1 = t - 1;
71
72 if (t < 0.5)
73 return 8 * t * t * t * t;
74 else
75 return 1 - 8 * t1 * t1 * t1 * t1;
76 }

◆ EaseInOutQuint()

static float Easing::EaseInOutQuint ( float t)
inlinestaticprivate

Definition at line 89 of file Easing.c.

90 {
91 float t1 = t - 1;
92
93 if (t < 0.5)
94 return 16 * t * t * t * t * t;
95 else
96 return 1 + 16 * t1 * t1 * t1 * t1 * t1;
97 }

◆ EaseInOutSine()

static float Easing::EaseInOutSine ( float t)
inlinestaticprivate

Definition at line 14 of file Easing.c.

15 {
16 return -0.5 * (Math.Cos(Math.PI * t) - 1);
17 }
static proto float Cos(float angle)
Returns cosinus of angle in radians.

References Math::Cos(), and Math::PI.

Referenced by ApplyForce(), EOnPostSimulate(), and PPERequester_GameplayBase::FadeColourMult().

◆ EaseInQuad()

static float Easing::EaseInQuad ( float t)
inlinestaticprivate

Definition at line 19 of file Easing.c.

20 {
21 return t * t;
22 }

◆ EaseInQuart()

static float Easing::EaseInQuart ( float t)
inlinestaticprivate

Definition at line 56 of file Easing.c.

57 {
58 return t * t * t * t;
59 }

Referenced by PPERequester_GameplayBase::SetFlashbangIntensity(), ShockHandler::Update(), and Update().

◆ EaseInQuint()

static float Easing::EaseInQuint ( float t)
inlinestaticprivate

Definition at line 78 of file Easing.c.

79 {
80 return t * t * t * t * t;
81 }

Referenced by OnUpdateTimerIn(), and KuruShake::Update().

◆ EaseInSine()

static float Easing::EaseInSine ( float t)
inlinestaticprivate

Definition at line 4 of file Easing.c.

5 {
6 return -1 * Math.Cos(t * (Math.PI / 2)) + 1;
7 }

References Math::Cos(), and Math::PI.

◆ EaseOutBack()

static float Easing::EaseOutBack ( float t,
float magnitude = 1.70158 )
inlinestaticprivate

Definition at line 160 of file Easing.c.

161 {
162 float scaledTime = (t / 1) - 1;
163 return (scaledTime * scaledTime * ((magnitude + 1) * scaledTime + magnitude)) + 1;
164 }

Referenced by RecoilBase::ApplyCamOffset().

◆ EaseOutBounce()

static float Easing::EaseOutBounce ( float t)
inlinestaticprivate

Definition at line 224 of file Easing.c.

225 {
226
227 float scaledTime = t / 1;
228
229 if (scaledTime < (1 / 2.75))
230
231 return 7.5625 * scaledTime * scaledTime;
232
233 else if (scaledTime < (2 / 2.75))
234 {
235
236 float scaledTime2 = scaledTime - (1.5 / 2.75);
237 return (7.5625 * scaledTime2 * scaledTime2) + 0.75;
238
239 }
240 else if (scaledTime < (2.5 / 2.75))
241 {
242
243 scaledTime2 = scaledTime - (2.25 / 2.75);
244 return (7.5625 * scaledTime2 * scaledTime2) + 0.9375;
245
246 }
247 else
248 {
249
250 scaledTime2 = scaledTime - (2.625 / 2.75);
251 return (7.5625 * scaledTime2 * scaledTime2) + 0.984375;
252
253 }
254 }

Referenced by EaseInBounce(), and EaseInOutBounce().

◆ EaseOutCirc()

static float Easing::EaseOutCirc ( float t)
inlinestaticprivate

Definition at line 137 of file Easing.c.

138 {
139 float t1 = t - 1;
140 return Math.Sqrt(1 - t1 * t1);
141 }

References Math::Sqrt().

◆ EaseOutCubic()

static float Easing::EaseOutCubic ( float t)
inlinestaticprivate

Definition at line 42 of file Easing.c.

43 {
44 float t1 = t - 1;
45 return t1 * t1 * t1 + 1;
46 }

Referenced by OnUpdateTimerOut().

◆ EaseOutElastic()

static float Easing::EaseOutElastic ( float t,
float magnitude = 0.7 )
inlinestaticprivate

Definition at line 194 of file Easing.c.

195 {
196 float p = 1 - magnitude;
197 float scaledTime = t * 2;
198
199 if (t == 0 || t == 1)
200 return t;
201
202 float s = p / (2 * Math.PI) * Math.Asin(1);
203 return (Math.Pow(2, -10 * scaledTime) * Math.Sin((scaledTime - s) * (2 * Math.PI) / p)) + 1;
204 }

References Math::Asin(), Math::PI, Math::Pow(), and Math::Sin().

◆ EaseOutExpo()

static float Easing::EaseOutExpo ( float t)
inlinestaticprivate

Definition at line 107 of file Easing.c.

108 {
109 if (t == 1)
110 return 1;
111
112 return (-Math.Pow(2, -10 * t) + 1);
113 }

References Math::Pow().

◆ EaseOutQuad()

static float Easing::EaseOutQuad ( float t)
inlinestaticprivate

Definition at line 24 of file Easing.c.

25 {
26 return t * (2 - t);
27 }

◆ EaseOutQuart()

static float Easing::EaseOutQuart ( float t)
inlinestaticprivate

Definition at line 61 of file Easing.c.

62 {
63 float t1 = t - 1;
64 return 1 - t1 * t1 * t1 * t1;
65 }

◆ EaseOutQuint()

static float Easing::EaseOutQuint ( float t)
inlinestaticprivate

Definition at line 83 of file Easing.c.

84 {
85 float t1 = t - 1;
86 return 1 + t1 * t1 * t1 * t1 * t1;
87 }

◆ EaseOutSine()

static float Easing::EaseOutSine ( float t)
inlinestaticprivate

Definition at line 9 of file Easing.c.

10 {
11 return Math.Sin(t * (Math.PI / 2));
12 }

References Math::PI, and Math::Sin().

Referenced by BleedingIndicatorDropData::AdjustColorSaturation(), and PPEMatClassParameterColor::ModifyResultValues().


The documentation for this class was generated from the following file: