Original Post
Right. So i have this class for animation that has a vector of keyframes in it. Each skinned mesh has it's own animation instance. Now, I was wondering, given 2 skinned meshes that have the same hierarchy (and perhaps vertices) I should be able to use the same animation data for both meshes. Basically this means I should be able to load 2 meshes, and reuse the same animation data for both. Yes? Ok, so my problem is this then. The animation data (ie keyframes) is stored in the vector within the animation class. If I clone the animation class, I want some properties to be copied (easy enough) and the keyframe data in the vector to be shared for both the meshes. How do I do this? I suppose some code will clear up what I'm trying to do: Other consideration aside (like ownership issues etc), is there some way to do this or should I just go back and use an array for kf to pull it off?
class animation
{
assorted data etc...
std::vector<keyframes> kfList;
//the clone function
animation* Clone()
{
animation* anim = new animation();
//the below is what I want to achieve but not sure how to do it for a vector
anim->kfList = this->kfList; //share the kf data though thru reference
return anim;
}
};