Crossfading animations
The most common use case for blending animations is crossfading between two animations. A crossfade is a fast blend from one animation to another. The goal of the crossfade is to hide the transition between two animations.
Once a crossfade is done, the active animation needs to be replaced by the animation that you are fading to. If you are fading to multiple animations, they are all evaluated. The ones that end the soonest are removed first. Animations that are requested are added to a list, and animations that have faded out are removed from the list.
In the following section, you will build a CrossFadeController
class that takes care of the crossfade logic. This class provides a simple intuitive API that makes fading between animations simple with just one function call.
Creating helper classes
When fading an animation into an already-sampled pose, you need to know what the animation being faded is, it's current playtime, the length of the...