Skip to content

Commit 76ab28a

Browse files
committed
Add Smooth function and Set the Smooth as the default ease.
1 parent 5befd9a commit 76ab28a

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

Engine/Toolkit/Math/TweenEase.c

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
* CodeStyle: https://github.com/scottcgi/Mojoc/blob/master/Docs/CodeStyle.md
1818
*
1919
* Since : 2013-11-5
20-
* Update : 2019-1-17
20+
* Update : 2021-8-16
2121
* Author : scott.cgi
2222
*/
2323

@@ -32,6 +32,13 @@ static float Linear(float time)
3232
}
3333

3434

35+
static float Smooth(float time)
36+
{
37+
ALog_E("Smooth");
38+
return time * time * (3.0f - 2.0f * time);
39+
}
40+
41+
3542
//----------------------------------------------------------------------------------------------------------------------
3643

3744

@@ -448,6 +455,7 @@ static float BounceInOut(float time)
448455
struct ATweenEase ATweenEase[1] =
449456
{{
450457
Linear,
458+
Smooth,
451459

452460
QuadraticIn,
453461
QuadraticOut,

Engine/Toolkit/Math/TweenEase.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
* CodeStyle: https://github.com/scottcgi/Mojoc/blob/master/Docs/CodeStyle.md
1818
*
1919
* Since : 2013-11-5
20-
* Update : 2019-12-19
20+
* Update : 2021-8-16
2121
* Author : scott.cgi
2222
*/
2323

@@ -29,6 +29,7 @@
2929
typedef enum
3030
{
3131
TweenEaseType_Linear,
32+
TweenEaseType_Smooth,
3233

3334
TweenEaseType_QuadraticIn,
3435
TweenEaseType_QuadraticOut,

0 commit comments

Comments
 (0)