Blending between the binding pose and animation clip
To blend from the binding pose to an animation clip, we add three new variables for the translation, scale, and rotation to every node. While the original variables store the node properties for the binding pose, the new variables will be used to save the node property changes that occur during the animation clips. By interpolating the translation, scale, and rotation values between the binding pose and the animation clip, we can control the amount of influence of the animation clip over the binding pose.
Let’s start by adding some new variables to the node class.
Enhancing the node class
The data type of the new variables must be the same as for the original values, so we just add three new variables with the prefix Blend
as new private
data members of the GltfNode
class to the GltfNode.h
file in the model
folder:
glm::vec3 mBlendScale = glm::vec3(1.0f);
glm::vec3...