Implementing poses
To store a parent-child hierarchy between transforms, you need to maintain two parallel vectors—one filled with transforms and one filled with integers. The integer array contains the index of the parent transform for each joint. Not all joints have parents; if a joint doesn't have a parent, its parent value is negative.
When thinking about a skeleton or pose, it's easy to think of a hierarchy that has one root node and many nodes that branch off it. In practice, it's not uncommon to have two or three root nodes. Sometimes, file formats store models in a way that the first node of the skeleton is a root node, but there is also a root node that all the skinned meshes are children of. These hierarchies tend to look like this:
There are three common poses for an animated character—the current pose, the bind pose, and the rest pose. The rest pose is the default configuration...