Implementing skeletons
When animating a model, there are several things to keep track of, such as the animated pose or inverse bind pose. The concept of a skeleton is to combine data that is shared between animated models into a single structure.
Both the bind pose and inverse bind pose are shared among all instances of a character. That is, if there are 15 characters on screen, each of them has a unique animated pose, but they all share the same rest pose, bind pose, inverse bind pose, and joint names.
In the following sections, you will implement a new class—the Skeleton
class. This Skeleton
class contains all the shared data that two animated meshes might need. It also keeps track of the rest pose, bind pose, inverse bind pose, and joint names. Some engines call the skeleton an armature or a rig.
The Skeleton class declaration
The Skeleton
class contains the rest pose and bind pose of a character, the name for every joint of the character, and—most importantly...