2 CLASS(Keyframe) EXTENDS(Animation)
3 METHOD(Keyframe, addAnim, void(entity, entity))
4 METHOD(Keyframe, calcValue, float(entity, float, float, float, float))
5 ATTRIB(Keyframe, currentChild, entity, NULL)
6 ATTRIB(Keyframe, firstChild, entity, NULL)
7 ATTRIB(Keyframe, lastChild, entity, NULL)
9 entity makeHostedKeyframe(entity, void(entity, float), float, float, float);
10 entity makeKeyframe(entity, void(entity, float), float, float, float);
14 entity makeHostedKeyframe(entity obj, void(entity, float) setter, float duration, float start, float end)
17 me = makeKeyframe(obj, setter, duration, start, end);
18 anim.addAnim(anim, me);
22 entity makeKeyframe(entity obj, void(entity, float) setter, float duration, float start, float end)
26 me.configureAnimation(me, obj, setter, time, duration, start, end);
30 void addAnimKeyframe(entity me, entity other)
33 error("Can't add already added anim!");
35 if(other.isFinished(other))
36 error("Can't add finished anim!");
45 l.nextSibling = other;
48 me.currentChild = other;
49 me.firstChild = other;
52 other.prevSibling = l;
53 other.nextSibling = NULL;
57 float calcValueKeyframe(entity me, float time, float duration, float startValue, float delta)
60 if (me.currentChild.isFinished(me.currentChild))
61 me.currentChild = me.currentChild.nextSibling;
65 me.currentChild.tick(me.currentChild, time);
66 return me.currentChild.value;
69 return startValue + delta;