示例#1
0
    public static List <PolyLine> ToCache(PolyLine source, PolyLine target, double speed, IEasing easing, bool interpolateXAxis = true)
    {
        int    steps = (int)(1 / speed);
        double p     = speed;
        var    cache = new List <PolyLine>(steps);

        for (int i = 0; i < steps; i++)
        {
            var clone = source.Clone();
            var easeP = easing.Ease(p);

            To(clone, target, easeP, interpolateXAxis);

            p += speed;

            cache.Add(clone);
        }

        return(cache);
    }