X-Git-Url: http://git.tdb.fi/?p=libs%2Fgl.git;a=blobdiff_plain;f=source%2Fanimation.h;h=92c177b685fead92aa15ee34c8721af1e16e4924;hp=83b369bfca1f1e975df889de113d9655ca77db80;hb=ff85f90d33023d908c534b0bf5d9a65e9fc2cce2;hpb=025016d7628be9c43b20999325dcbaae5cb3c3b8 diff --git a/source/animation.h b/source/animation.h index 83b369bf..92c177b6 100644 --- a/source/animation.h +++ b/source/animation.h @@ -86,6 +86,16 @@ private: virtual void apply(float, KeyFrame::AnimatedUniform &) const; }; + template + struct ExtractUniform + { + const std::string &name; + + ExtractUniform(const std::string &n): name(n) { } + + bool operator()(const KeyFrame &, typename Interpolate::SplineValue::Type &) const; + }; + struct TimedKeyFrame { Time::TimeDelta time; @@ -156,8 +166,11 @@ private: void add_keyframe(const Time::TimeDelta &, const RefPtr &, float, float); void prepare_keyframe(TimedKeyFrame &); void create_curves(); - template - void create_uniform_curve(const std::string &); + template + void create_curve(CurveTarget target, const T &); + static bool extract_position(const KeyFrame &, Vector3 &); + static bool extract_euler(const KeyFrame &, Vector3 &); + static bool extract_scale(const KeyFrame &, Vector3 &); public: void add_event(const Time::TimeDelta &, const std::string &, const Variant & = Variant());