Creating the Track class
A Track
class is a collection of frames. Interpolating a track returns the data type of the track; the result is the value along whatever curve the track defines at a specific point in time. A track must have at least two frames to interpolate between.
As mentioned in the Creating the Frame struct section, by following the examples in this book, you will implement explicit frame and track types. There will be separate classes for scalar, vector, and quaternion tracks. These classes are templated to avoid having to write duplicate code. A vec3
track, for example, contains the Frame<3>
type frames.
Because tracks have an explicit type, you can't make a keyframe in the X component of a vec3
track without also adding a keyframe to the Y and Z components as well.
This can eat up more memory if you have a component that doesn't change. For example, notice how, in the following figure, the Z component has many frames, even though it&apos...