4.4. Animations, Tracks and Keyframes

The Cal3D library stores every motion such as walking, jumping, waving etc. in a separate core animation inside the core model. These animations contain one core track for each bone that is affected by the specific motion.

Example 4-2. The waving Walker

Say we have a walking, human-like model waving with his right hand. There are 2 animations in this scenario, the one for walking and the other for waving. The walking animation does most likely contain a track for every bone there is to have a fully animated model. The waving animation will only be defined locally, so only tracks for the right hand, arm, shoulder and probably neck and head are stored within. This selective inclusion allows a powerful blending and overlay mechanism as we will see in The 'Mixer'.

The actual transformation data for a bone is stored in several core keyframes that are contained in the corresponding track. Each keyframe holds a relative rotation and a relative translation to the parent bone for a specified point of time. These values are interpolated between two following keyframes by the Cal3D library to achieve a smooth motion.

All the above data can be shared between different model instances and is therefore completely stored in the Core Classes. The active set of animations and their blending state is what makes the difference here, so these values are defined in each model instance separately.