mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-07-13 15:44:36 +00:00
self modifying variables made clang unhappy. retooled circular ease methods
basis: http://gizma.com/easing/#circ1
This commit is contained in:
parent
1131ed15df
commit
d50762cbef
1 changed files with 6 additions and 4 deletions
|
|
@ -289,13 +289,15 @@ inline F32 mEaseInOutExpo(F32 t, F32 b, F32 c, F32 d)
|
||||||
// t: current time, b: beginning value, c: change in position, d: duration
|
// t: current time, b: beginning value, c: change in position, d: duration
|
||||||
inline F32 mEaseInCirc (F32 t, F32 b, F32 c, F32 d)
|
inline F32 mEaseInCirc (F32 t, F32 b, F32 c, F32 d)
|
||||||
{
|
{
|
||||||
return -c * (mSqrt(1 - (t/=d)*t) - 1) + b;
|
t/=d;
|
||||||
|
return -c * (mSqrt(1 - (t)*t) - 1) + b;
|
||||||
};
|
};
|
||||||
|
|
||||||
// circular easing out - decelerating to zero velocity
|
// circular easing out - decelerating to zero velocity
|
||||||
inline F32 mEaseOutCirc (F32 t, F32 b, F32 c, F32 d)
|
inline F32 mEaseOutCirc (F32 t, F32 b, F32 c, F32 d)
|
||||||
{
|
{
|
||||||
return c * mSqrt(1 - (t=t/d-1)*t) + b;
|
t/=d;
|
||||||
|
return c * mSqrt(1 - (t-1)*t) + b;
|
||||||
};
|
};
|
||||||
|
|
||||||
// circular easing in/out - acceleration until halfway, then deceleration
|
// circular easing in/out - acceleration until halfway, then deceleration
|
||||||
|
|
@ -303,8 +305,8 @@ inline F32 mEaseInOutCirc(F32 t, F32 b, F32 c, F32 d)
|
||||||
{
|
{
|
||||||
if ((t/=d/2) < 1)
|
if ((t/=d/2) < 1)
|
||||||
return -c/2 * (mSqrt(1 - t*t) - 1) + b;
|
return -c/2 * (mSqrt(1 - t*t) - 1) + b;
|
||||||
|
t-=2;
|
||||||
return c/2 * (mSqrt(1 - (t-=2)*t) + 1) + b;
|
return c/2 * (mSqrt(1 - (t)*t) + 1) + b;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue