2 CLASS(Easing) EXTENDS(Animation)
3 METHOD(Easing, calcValue, float(entity, float, float, float, float))
4 METHOD(Easing, setMath, void(entity, float(float, float, float, float)))
5 ATTRIB(Easing, math, float(float, float, float, float), easingLinear)
7 entity makeHostedEasing(entity, void(entity, float), float(float, float, float, float), float, float, float);
8 entity makeEasing(entity, void(entity, float), float(float, float, float, float), float, float, float, float);
9 float easingLinear(float, float, float, float);
10 float easingQuadIn(float, float, float, float);
11 float easingQuadOut(float, float, float, float);
12 float easingQuadInOut(float, float, float, float);
16 entity makeHostedEasing(entity obj, void(entity, float) objSetter, float(float, float, float, float) func, float animDuration, float animStartValue, float animEnd)
19 me = makeEasing(obj, objSetter, func, time, animDuration, animStartValue, animEnd);
20 anim.addAnim(anim, me);
24 entity makeEasing(entity obj, void(entity, float) objSetter, float(float, float, float, float) func, float animStartTime, float animDuration, float animStartValue, float animEnd)
28 me.configureAnimation(me, obj, objSetter, animStartTime, animDuration, animStartValue, animEnd);
33 float Easing_calcValue(entity me, float tickTime, float animDuration, float animStart, float animDelta)
35 return me.math(tickTime, animDuration, animStart, animDelta);
38 void Easing_setMath(entity me, float(float, float, float, float) func)
43 float easingLinear(float tickTime, float animDuration, float animStart, float animDelta)
45 return (animDelta * (tickTime / animDuration)) + animStart;
48 float easingQuadIn(float tickTime, float animDuration, float animStart, float animDelta)
50 float frac = tickTime / animDuration;
51 return (animDelta * frac * frac) + animStart;
54 float easingQuadOut(float tickTime, float animDuration, float animStart, float animDelta)
56 float frac = tickTime / animDuration;
57 return (-animDelta * frac * (frac - 2)) + animStart;
60 float easingQuadInOut(float tickTime, float animDuration, float animStart, float animDelta)
62 if (tickTime < (animDuration / 2))
64 return easingQuadIn(tickTime, (animDuration / 2), animStart, (animDelta / 2));
68 return easingQuadOut((tickTime - (animDuration / 2)), (animDuration / 2), (animStart + (animDelta / 2)), (animDelta / 2));