I have been working on animation in my small game engine recently and I am implementing some interpolation to be used with skeletal animations. I know how to do interpolation but I am not sure where to put the equation that I get out of it.
Do I save an equation for each channel of every bone in the data structure? Maybe something along the lines of:
struct Channel
{
std::string boneName;
std::vector<KeyFrame> keyframes;
// These equations will be used to find the position/rotation/scale of
// the bone at t time.
std::vector<float> rotEqX, rotEqY, rotEqZ;
std::vector<float> translateEqX, translateEqY, translateEqZ;
std::vector<float> scaleEqX, scaleEqY, scaleEqZ;
};
Do I just calculate the equation every time I want to update the animation? (Seems a little inefficient?)