]> git.tdb.fi Git - libs/gl.git/blobdiff - source/animation.h
Keep track of which components have been set in Transform
[libs/gl.git] / source / animation.h
index 92c177b685fead92aa15ee34c8721af1e16e4924..011c8558ca52f32659247c263b7cdb17f46359c5 100644 (file)
@@ -28,6 +28,7 @@ public:
                Time::TimeDelta current_time;
                float start_slope;
                float end_slope;
+               int slopes_set;
 
        public:
                Loader(Animation &);
@@ -36,6 +37,13 @@ public:
                void init();
                virtual void finish();
 
+               void check_slopes_and_control(bool, bool);
+               void add_kf(const KeyFrame *, bool, bool);
+               void load_kf(const std::string &, bool);
+               void load_kf_inline(bool);
+
+               void control_keyframe(const std::string &);
+               void control_keyframe_inline();
                void event(const std::string &);
                void event1i(const std::string &, int);
                void event1f(const std::string &, float);
@@ -77,7 +85,7 @@ private:
                typedef typename Interpolate::SplineKnot<float, N> Knot;
 
        private:
-               Interpolate::Spline<float, 1, N> spline;
+               Interpolate::Spline<float, 3, N> spline;
 
        public:
                ValueCurve(CurveTarget, const std::vector<Knot> &);
@@ -99,9 +107,8 @@ private:
        struct TimedKeyFrame
        {
                Time::TimeDelta time;
-               float start_slope;
-               float end_slope;
                RefPtr<const KeyFrame> keyframe;
+               bool control;
        };
 
        struct Event
@@ -160,10 +167,12 @@ public:
        const std::string &get_uniform_name(unsigned) const;
 
        void add_keyframe(const Time::TimeDelta &, const KeyFrame &);
-       void add_keyframe(const Time::TimeDelta &, const KeyFrame &, float);
-       void add_keyframe(const Time::TimeDelta &, const KeyFrame &, float, float);
+       DEPRECATED void add_keyframe(const Time::TimeDelta &, const KeyFrame &, float);
+       DEPRECATED void add_keyframe(const Time::TimeDelta &, const KeyFrame &, float, float);
+       void add_control_keyframe(const KeyFrame &);
 private:
-       void add_keyframe(const Time::TimeDelta &, const RefPtr<const KeyFrame> &, float, float);
+       void add_keyframe(const Time::TimeDelta &, const KeyFrame *, float, float, bool);
+       void add_keyframe(const Time::TimeDelta &, const KeyFrame *, bool, bool);
        void prepare_keyframe(TimedKeyFrame &);
        void create_curves();
        template<unsigned N, typename T>
@@ -177,6 +186,7 @@ public:
        const Msp::Time::TimeDelta &get_duration() const;
 
        void set_looping(bool);
+       bool is_looping() const { return looping; }
 };
 
 } // namespace GL