Crossfading animations
While the default animation blending uses the binding position with the joint weights as the starting point, crossfading interpolates between two animation clips. We could use the same animation clip as both the source and destination, but this would just play the animation, regardless of the position of the crossfading slider.
We will enhance the GltfModel
class to store the values for two animation clips, instead of only the binding pose and one animation clip. For the renderer, new shared variables are needed, containing the second clip name and the percentage of blending between the two clips. The user interface must also reflect the new blending mode and new controls, like the selected destination clip, or a slider to adjust the percentage of the blending between the two clips. As the first step, we’ll update the model class.
Upgrading the model classes
To set the starting point of the glTF model to an animation, we will abuse the default...