void Animation::set_armature(const Armature &a)
{
+ if(!keyframes.empty() && &a!=armature)
+ throw invalid_operation("Animation::set_armature");
armature = &a;
}
throw invalid_argument("Animation::add_keyframe");
if(!keyframes.empty() && t<keyframes.back().time)
throw invalid_argument("Animation::add_keyframe");
+ if(kf->get_pose() && armature && kf->get_pose()->get_armature()!=armature)
+ throw invalid_argument("Animation::add_keyframe");
bool realloc = (keyframes.size()>=keyframes.capacity());
+ if(kf->get_pose() && !armature)
+ armature = kf->get_pose()->get_armature();
+
keyframes.push_back(TimedKeyFrame());
TimedKeyFrame &tkf = keyframes.back();
tkf.time = t;
Pose(const Armature &);
void set_armature(const Armature &);
+ const Armature *get_armature() const { return armature; }
void rotate_link(unsigned, float, const Vector3 &);
const Matrix &get_link_matrix(unsigned) const;
};