bool realloc = (keyframes.size()>=keyframes.capacity());
- keyframes.push_back(TimedKeyFrame(*this));
+ keyframes.push_back(TimedKeyFrame());
TimedKeyFrame &tkf = keyframes.back();
tkf.time = t;
tkf.keyframe = kf;
uniforms.push_back(UniformInfo(i->first, i->second.size));
}
- tkf.prepare();
+ tkf.prepare(*this);
}
}
-Animation::TimedKeyFrame::TimedKeyFrame(const Animation &a):
- animation(a),
+Animation::TimedKeyFrame::TimedKeyFrame():
prev(0)
{ }
-void Animation::TimedKeyFrame::prepare()
+void Animation::TimedKeyFrame::prepare(const Animation &animation)
{
const KeyFrame::UniformMap &kf_uniforms = keyframe->get_uniforms();
for(KeyFrame::UniformMap::const_iterator i=kf_uniforms.begin(); i!=kf_uniforms.end(); ++i)
struct TimedKeyFrame
{
- const Animation &animation;
const TimedKeyFrame *prev;
Time::TimeDelta time;
Time::TimeDelta delta_t;
std::vector<KeyFrame::AnimatedUniform> uniforms;
std::vector<MatrixInterpolation> pose_matrices;
- TimedKeyFrame(const Animation &);
- void prepare();
+ TimedKeyFrame();
+ void prepare(const Animation &);
};
struct UniformInfo