A state maintainer for a smooth transition between numerically-specified states. Example numeric states include floats or Transfornm objects. An initial state is set with the constructor or set(startValue). A corresponding end state and transition are set with set(endValue, transition). Subsequent calls to set(endValue, transition) begin at the last state. Calls to get(timestamp) provide the _interpolated state along the way. Note that there is no event loop here - calls to get() are the only way to find out state projected to the current (or provided) time and are the only way to trigger callbacks. Usually this kind of object would be part of the render() path of a visible component.
TODO beginning state
Transition curves mapping independent variable t from domain [0,1] to a range within [0,1]. Includes functions 'linear', 'easeIn', 'easeOut', 'easeInOut', 'easeOutBounce', 'spring'.
Add "unit" curve to internal dictionary of registered curves.
Remove object with key "curveName" from internal dictionary of registered curves.
Retrieve function with key "curveName" from internal dictionary of registered curves. Default curves are defined in the TweenTransition.Curves array, where the values represent unitCurve functions.
Retrieve all available curves.
Set internal options, overriding any default options.
Add transition to end state to the queue of pending transitions. Special Use: calling without a transition resets the object to that state with no pending actions
Cancel all transitions and reset to a stable state
Get current velocity
Get interpolated state of current action at provided time. If the last action has completed, invoke its callback.
Update internal state to the provided timestamp. This may invoke the last callback and begin a new action.
Is there at least one action pending completion?
Halt transition at current state and erase all pending actions.