2 using System.Collections.Generic;
8 /// The AnimatorMotionMapper interface
10 public interface AnimatorMotionMapper
13 /// Maps an input position from 0.0 to 1.0 along a timeline to a position in a different curve
15 double Caculate(double position);
19 /// The LinearMotionMapper class
21 public class LinearMotionMapper : AnimatorMotionMapper
24 /// Maps an input position from 0.0 to 1.0 along a timeline to a position in a different curve
26 public double Caculate(double position)
28 return Interop.Ecore.ecore_animator_pos_map(position, Interop.Ecore.PositionMap.Linear, 0, 0);
33 /// The AccelerateMotionMapper class
35 public class AccelerateMotionMapper : AnimatorMotionMapper
38 /// Maps an input position from 0.0 to 1.0 along a timeline to a position in a different curve
40 public double Caculate(double position)
42 return Interop.Ecore.ecore_animator_pos_map(position, Interop.Ecore.PositionMap.Accelerate, 0, 0);
47 /// The DecelerateMotionMapper class
49 public class DecelerateMotionMapper : AnimatorMotionMapper
52 /// Maps an input position from 0.0 to 1.0 along a timeline to a position in a different curve
54 public double Caculate(double position)
56 return Interop.Ecore.ecore_animator_pos_map(position, Interop.Ecore.PositionMap.Decelerate, 0, 0);
61 /// The SinusoidalMotionMapper class
63 public class SinusoidalMotionMapper : AnimatorMotionMapper
66 /// Maps an input position from 0.0 to 1.0 along a timeline to a position in a different curve
68 public double Caculate(double position)
70 return Interop.Ecore.ecore_animator_pos_map(position, Interop.Ecore.PositionMap.Sinusoidal, 0, 0);
75 /// The AccelerateFactorMotionMapper class
77 public class AccelerateFactorMotionMapper : AnimatorMotionMapper
80 /// The power factor of AccelerateFactorMotionMapper
82 public double PowerFactor { get; set; } = 0;
85 /// Maps an input position from 0.0 to 1.0 along a timeline to a position in a different curve
87 public double Caculate(double position)
89 return Interop.Ecore.ecore_animator_pos_map(position, Interop.Ecore.PositionMap.AccelerateFactor, PowerFactor, 0);
94 /// The DecelerateFactorMotionMapper class
96 public class DecelerateFactorMotionMapper : AnimatorMotionMapper
99 /// The power factor of DecelerateFactorMotionMapper
101 public double PowerFactor { get; set; } = 0;
104 /// Maps an input position from 0.0 to 1.0 along a timeline to a position in a different curve
106 public double Caculate(double position)
108 return Interop.Ecore.ecore_animator_pos_map(position, Interop.Ecore.PositionMap.DecelerateFactor, PowerFactor, 0);
113 /// The SinusoidalFactorMotionMapper class
115 public class SinusoidalFactorMotionMapper : AnimatorMotionMapper
118 /// The power factor of SinusoidalFactorMotionMapper
120 public double PowerFactor { get; set; } = 0;
123 /// Maps an input position from 0.0 to 1.0 along a timeline to a position in a different curve
125 public double Caculate(double position)
127 return Interop.Ecore.ecore_animator_pos_map(position, Interop.Ecore.PositionMap.SinusoidalFactor, PowerFactor, 0);
132 /// The DivisorInterpolatedMotionMapper class
134 public class DivisorInterpolatedMotionMapper : AnimatorMotionMapper
137 /// The Divisor of DivisorInterpolatedMotionMapper
139 public double Divisor { get; set; } = 0;
142 /// The power of DivisorInterpolatedMotionMapper
144 public double Power { get; set; } = 0;
147 /// Maps an input position from 0.0 to 1.0 along a timeline to a position in a different curve
149 public double Caculate(double position)
151 return Interop.Ecore.ecore_animator_pos_map(position, Interop.Ecore.PositionMap.DivisorInterp, Divisor, Power);
156 /// The BounceMotionMapper class
158 public class BounceMotionMapper : AnimatorMotionMapper
161 /// The bounces of BounceMotionMapper
163 public int Bounces { get; set; } = 0;
166 /// The decay factor of BounceMotionMapper
168 public double DecayFactor { get; set; } = 0;
171 /// Maps an input position from 0.0 to 1.0 along a timeline to a position in a different curve
173 public double Caculate(double position)
175 return Interop.Ecore.ecore_animator_pos_map(position, Interop.Ecore.PositionMap.Bounce, DecayFactor, Bounces);
180 /// The SpringMotionMapper class
182 public class SpringMotionMapper : AnimatorMotionMapper
185 /// The wobbles of SpringMotionMapper
187 public int Wobbles { get; set; } = 0;
190 /// The decat factir of SpringMotionMapper
192 public double DecayFactor { get; set; } = 0;
195 /// Maps an input position from 0.0 to 1.0 along a timeline to a position in a different curve
197 public double Caculate(double position)
199 return Interop.Ecore.ecore_animator_pos_map(position, Interop.Ecore.PositionMap.Bounce, DecayFactor, Wobbles);
204 /// The CubicBezierMotionMapper class
206 public class CubicBezierMotionMapper : AnimatorMotionMapper
209 /// The X1 of CubicBezierMotionMapper
211 public double X1 { get; set; } = 0;
214 /// The Y1 of CubicBezierMotionMapper
216 public double Y1 { get; set; } = 0;
219 /// The X2 of CubicBezierMotionMapper
221 public double X2 { get; set; } = 0;
224 /// The Y2 of CubicBezierMotionMapper
226 public double Y2 { get; set; } = 0;
229 /// Maps an input position from 0.0 to 1.0 along a timeline to a position in a different curve
231 public double Caculate(double position)
233 double[] values = { X1, Y1, X2, Y2 };
234 return Interop.Ecore.ecore_animator_pos_map_n(position, Interop.Ecore.PositionMap.Bounce, values.Length, values);