It seems kind of complicated for convenient functions.
What was the reason to remove usefull functions and replace them with other
usefull but not keep all?
Emmanuele Bassi wrote:
On Mon, 2009-03-09 at 22:50 -0400, Vlad Seryakov wrote:
What is the analog of clutter_smoothstep_inc_func in the latest Git version?
there is no equivalent.
the equation for the increasing variant of the smoothstep function is:
f(x) = -2x^3 + 3x^2
so you probably want a cubic easing - the EASE_IN_OUT_CUBIC is similar
in progress to the smoothstep across the [ 0, 1 ] interval.
*or*, you can write your own function, like this:
static gdouble
my_smoothstep_inc (ClutterAlpha *alpha,
gpointer data)
{
ClutterTimeline *timeline = clutter_alpha_get_timeline (alpha);
gdouble progress = clutter_timeline_get_progress (timeline);
/* always defined within [ 0, 1 ] */
return -2.0 * (pow (progress, 3)) + 3.0 * (pow (progress, 2));
}
and then register it as a global alpha function, for instance inside an
initialization function of your project:
extern gulong MY_SMOOTHSTEP_INC;
MY_SMOOTHSTEP_INC = clutter_alpha_register_func (my_smoothstep_inc,
NULL);
you can then reuse MY_SMOOTHSTEP_INC across your project when creating
new ClutterAlpha instances or when using the clutter_actor_animate()
implicit animation API.
ciao,
Emmanuele.
--
To unsubscribe send a mail to [email protected]