I would create an Animation class containing the std::vector<Skeleton> data element, which can be used to control individual Skeleton objects on each frame or interpolated through several Skeleton objects in the key frame vector. Then, when you βplayβ the animation, you just need to iterate over the vector, calling each Skeleton object and passing it to some other function or class that displays the results on the screen (or does something else Skeleton may be useful, for example, mesh deformation, etc.)
The presence of an animation object will greatly facilitate the manipulation of animation frames, allowing you to delete / replace frames, etc. Otherwise, if you try to collect all this functionality into a Skeleton object, then you are going to find a lot of luggage there when you try to manipulate certain aspects of the Skeleton separately from the animation sequence (i.e., suppose you need to change the Skeleton hierarchy for the frame segment and etc.? ... it would be very simple if there is a skeleton on each frame, but not if you have a monolithic Skelton object).
Jason source share