2019-12-17 05:15:33 -08:00
|
|
|
class Efl.Cubic_Bezier_Interpolator extends Efl.Object implements Efl.Interpolator
|
2017-09-12 01:49:40 -07:00
|
|
|
{
|
2019-11-05 11:26:14 -08:00
|
|
|
[[Cubic Bezier interpolator. It starts slow, then moves quickly and then slows down
|
|
|
|
again before stopping.
|
|
|
|
|
|
|
|
The exact shape of the mapping curve can be modified through the @.control_points
|
|
|
|
property.
|
2019-12-17 05:15:33 -08:00
|
|
|
|
|
|
|
@since 1.24
|
2019-11-05 11:26:14 -08:00
|
|
|
]]
|
2018-11-23 04:26:00 -08:00
|
|
|
data: Efl_Cubic_Bezier_Interpolator_Data;
|
2017-09-12 01:49:40 -07:00
|
|
|
methods {
|
2019-11-05 11:26:14 -08:00
|
|
|
@property control_points {
|
|
|
|
[[Cubic Bezier curves are described by 4 2D control points
|
|
|
|
(https://en.wikipedia.org/wiki/B%C3%A9zier_curve).
|
|
|
|
For each control point, the X coordinate is an input value and the Y coordinate is the
|
|
|
|
corresponding output value.
|
|
|
|
The first one, P0, is set to $[(0,0)]: The input $[0.0] is mapped to the $[0.0] output.
|
|
|
|
The last one, P3, is set to $[(1,1)]: The input $[1.0] is mapped to the $[1.0] output.
|
|
|
|
The other two control points can be set through this property and control the shape of
|
|
|
|
the curve. Note that the control points do not need to be in the $[0...1] range, and
|
|
|
|
neither do the output values of the curve.
|
|
|
|
]]
|
2017-09-12 01:49:40 -07:00
|
|
|
set {
|
|
|
|
}
|
|
|
|
get {
|
|
|
|
}
|
|
|
|
values {
|
2019-11-05 11:26:14 -08:00
|
|
|
p1: Eina.Vector2; [[P1 control point.]]
|
|
|
|
p2: Eina.Vector2; [[P2 control point.]]
|
2017-09-12 01:49:40 -07:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
implements {
|
|
|
|
Efl.Object.constructor;
|
|
|
|
Efl.Interpolator.interpolate;
|
|
|
|
}
|
|
|
|
}
|