555
joints within the skeleton, plus weights governing how much infl uence
each joint should have on that vertex’s position.
- Animation clips. Many hundreds or even thousands of animation clips
are created for a character’s skeleton. These may be full-body clips, par-
tial-skeleton clips, or diff erence clips for use in additive blending.
A UML diagram of these data structures is shown in Figure 11.45. Pay
particular att ention to the cardinality and direction of the relationships between
these classes. The cardinality is shown just beside the tip or tail of the relation-
ship arrow between classes—a one represents a single instance of the class,
while an asterisk indicates many instances. For any one type of character, there
will be one skeleton, one or more meshes, and one or more animation clips.
The skeleton is the central unifying element—the skins are att ached to the
skeleton but don’t have any relationship with the animation clips. Likewise,
the clips are targeted at a particular skeleton, but they have no “knowledge”
of the skin meshes. Figure 11.46 illustrates these relationships.
Game designers oft en try to reduce the number of unique skeletons in
the game to one, or just a few, because each new skeleton generally requires
a whole new set of animation clips. To provide the illusion of many diff erent
1
*
1*
1
*
Skeleton
-uniqueId : int
-jointCount : int
-joints : SkeletonJoint
SkeletonJoint
-name : string
-parentIndex : int
-invBindPose : Matrix44
1
*
1*
1
*
Mesh
-indices : int
-vertices : Vertex
-skeletonId : int
AnimationClip
-nameId : int
-duration : float
-poseSamples : AnimationPose
Vertex
-position : Vector 3
-normal : Vector3
-uv : Vector2
-jointIndices : int
-jointWeights : float
SQT
-scale : Vector 3
-rotation : Quaternion
-translation : Vector 3
AnimationPose
-jointPoses : SQT
Figure 11.45. UML diagram of shared animation resources.
11.10. The Animation Pipeline