52
52
unsigned long _ElapsedTime;
56
// template <typename T>
57
// class PropertyAnimationContainer
62
// class AnimatedPropertyBase
65
// AnimatedPropertyBase(){};
67
// virtual void Animate(float t){};
71
// // Explicit specialization. The explicit type could be float, int, Color....
73
// class PropertyAnimationContainer<float> : public AnimatedPropertyBase
76
// PropertyAnimationContainer(Property<float>& prop, float start_value, float end_value)
79
// start_value_ = start_value;
80
// end_value_ = end_value;
83
// virtual void Animate(float t)
85
// float value = (1.0f - t) * start_value_ + t * end_value_;
89
// Property<float>& prop_;
90
// float start_value_;
96
// class PropertyAnimationContainer<Color> : public AnimatedPropertyBase
99
// PropertyAnimationContainer(Property<Color>& prop, Color start_value, Color end_value)
102
// start_value_ = start_value;
103
// end_value_ = end_value;
106
// virtual void Animate(float t)
108
// Color value = (1.0f - t) * start_value_ + t * end_value_;
112
// Property<Color>& prop_;
113
// Color start_value_;
118
// class AnimationTimeline : public Object
121
// AnimationTimeline() {};
123
// template <typename T>
124
// void AddProperty(Property<T>& prop, T start_value, T end_value)
126
// PropertyAnimationContainer<T>* a = new PropertyAnimationContainer<T> (prop, start_value, end_value);
128
// animated_properties_.push_back(a);
131
// void Animate(float t)
133
// std::list<AnimatedPropertyBase*>::iterator it;
135
// // Go through all the properties and update them.
136
// for(it = animated_properties_.begin(); it != animated_properties_.end(); ++it)
138
// (*it)->Animate(t);
142
// std::list<AnimatedPropertyBase*> animated_properties_;
56
146
#endif // TIMELINE_H