13 entity makeEasing(
entity obj,
void(
entity,
float) objSetter,
float(
float,
float,
float,
float) func,
float animStartTime,
float animDuration,
float animStartValue,
float animEnd)
16 this.configureAnimation(
this, obj, objSetter, animStartTime, animDuration, animStartValue, animEnd);
17 this.setMath(
this, func);
21 METHOD(
Easing, calcValue,
float(
entity this,
float tickTime,
float animDuration,
float animStart,
float animDelta))
23 return this.math(tickTime, animDuration, animStart, animDelta);
31 float easingLinear(
float tickTime,
float animDuration,
float animStart,
float animDelta)
33 return (animDelta * (tickTime / animDuration)) + animStart;
36 float easingQuadIn(
float tickTime,
float animDuration,
float animStart,
float animDelta)
38 float frac = tickTime / animDuration;
39 return (animDelta * frac * frac) + animStart;
42 float easingQuadOut(
float tickTime,
float animDuration,
float animStart,
float animDelta)
44 float frac = tickTime / animDuration;
45 return (-animDelta * frac * (frac - 2)) + animStart;
48 float easingQuadInOut(
float tickTime,
float animDuration,
float animStart,
float animDelta)
50 if (tickTime < (animDuration / 2))
return easingQuadIn(tickTime, (animDuration / 2), animStart, (animDelta / 2));
51 else return easingQuadOut((tickTime - (animDuration / 2)), (animDuration / 2), (animStart + (animDelta / 2)), (animDelta / 2));
float easingLinear(float tickTime, float animDuration, float animStart, float animDelta)
entity makeEasing(entity obj, void(entity, float) objSetter, float(float, float, float, float) func, float animStartTime, float animDuration, float animStartValue, float animEnd)
float easingQuadInOut(float tickTime, float animDuration, float animStart, float animDelta)
#define METHOD(cname, name, prototype)
float easingQuadIn(float tickTime, float animDuration, float animStart, float animDelta)
float easingQuadOut(float tickTime, float animDuration, float animStart, float animDelta)
entity makeHostedEasing(entity obj, void(entity, float) objSetter, float(float, float, float, float) func, float animDuration, float animStartValue, float animEnd)