2 using System.Collections.Generic;
7 public interface AnimatorMotionMapper
9 double Caculate(double position);
12 public class LinearMotionMapper : AnimatorMotionMapper
14 public double Caculate(double position)
16 return Interop.Ecore.ecore_animator_pos_map(position, Interop.Ecore.PositionMap.Linear, 0, 0);
20 public class AccelerateMotionMapper : AnimatorMotionMapper
22 public double Caculate(double position)
24 return Interop.Ecore.ecore_animator_pos_map(position, Interop.Ecore.PositionMap.Accelerate, 0, 0);
28 public class DecelerateMotionMapper : AnimatorMotionMapper
30 public double Caculate(double position)
32 return Interop.Ecore.ecore_animator_pos_map(position, Interop.Ecore.PositionMap.Decelerate, 0, 0);
36 public class SinusoidalMotionMapper : AnimatorMotionMapper
38 public double Caculate(double position)
40 return Interop.Ecore.ecore_animator_pos_map(position, Interop.Ecore.PositionMap.Sinusoidal, 0, 0);
44 public class AccelerateFactorMotionMapper : AnimatorMotionMapper
46 public double PowerFactor { get; set; } = 0;
48 public double Caculate(double position)
50 return Interop.Ecore.ecore_animator_pos_map(position, Interop.Ecore.PositionMap.AccelerateFactor, PowerFactor, 0);
54 public class DecelerateFactorMotionMapper : AnimatorMotionMapper
56 public double PowerFactor { get; set; } = 0;
58 public double Caculate(double position)
60 return Interop.Ecore.ecore_animator_pos_map(position, Interop.Ecore.PositionMap.DecelerateFactor, PowerFactor, 0);
64 public class SinusoidalFactorMotionMapper : AnimatorMotionMapper
66 public double PowerFactor { get; set; } = 0;
68 public double Caculate(double position)
70 return Interop.Ecore.ecore_animator_pos_map(position, Interop.Ecore.PositionMap.SinusoidalFactor, PowerFactor, 0);
74 public class DivisorInterpolatedMotionMapper : AnimatorMotionMapper
76 public double Divisor { get; set; } = 0;
77 public double Power { get; set; } = 0;
79 public double Caculate(double position)
81 return Interop.Ecore.ecore_animator_pos_map(position, Interop.Ecore.PositionMap.DivisorInterp, Divisor, Power);
85 public class BounceMotionMapper : AnimatorMotionMapper
87 public int Bounces { get; set; } = 0;
88 public double DecayFactor { get; set; } = 0;
89 public double Caculate(double position)
91 return Interop.Ecore.ecore_animator_pos_map(position, Interop.Ecore.PositionMap.Bounce, DecayFactor, Bounces);
95 public class SpringMotionMapper : AnimatorMotionMapper
97 public int Wobbles { get; set; } = 0;
98 public double DecayFactor { get; set; } = 0;
100 public double Caculate(double position)
102 return Interop.Ecore.ecore_animator_pos_map(position, Interop.Ecore.PositionMap.Bounce, DecayFactor, Wobbles);
106 public class CubicBezierMotionMapper : AnimatorMotionMapper
108 public double X1 { get; set; } = 0;
109 public double Y1 { get; set; } = 0;
110 public double X2 { get; set; } = 0;
111 public double Y2 { get; set; } = 0;
113 public double Caculate(double position)
115 double[] values = { X1, Y1, X2, Y2 };
116 return Interop.Ecore.ecore_animator_pos_map_n(position, Interop.Ecore.PositionMap.Bounce, values.Length, values);