Ejemplo n.º 1
0
        // Mutators

        public void Copy(BezierChain3D rhs)
        {
            this.curves.Clear();
            foreach (var c in rhs.curves)
            {
                this.curves.Add(c);
            }
        }
Ejemplo n.º 2
0
        // TODO: implement subdivide/upres

        public static void Lerp(BezierChain3D a, BezierChain3D b, float t, ref BezierChain3D dst)
        {
            if (a.curves.Count != b.curves.Count)
            {
                Debug.LogErrorFormat("Currently cannot lerp 2 chains of different curveCount. A curveCount: {0}, B curveCount: {1} ",
                                     a.curves.Count, b.curves.Count
                                     );
                return;
            }

            dst.curves.Clear();
            int cCount = a.curves.Count;

            for (int i = 0; i < cCount; i++)
            {
                var aCurve = a.curves[i];
                var bCurve = a.curves[i];
                dst.curves.Add(BezierCurve3D.Lerp(aCurve, bCurve, t));
            }
        }
Ejemplo n.º 3
0
 public static bool CanLerp(BezierChain3D a, BezierChain3D b)
 {
     return(a.curves.Count == b.curves.Count);
 }