Пример #1
0
        public Vector3 GetPoint(float t)
        {
            int i;

            if (t >= 1f)
            {
                t = 1f;
                i = points.Length - 4;
            }
            else
            {
                t  = Mathf.Clamp01(t) * CurveCount;
                i  = (int)t;
                t -= i;
                i *= 3;
            }

            return(transform.TransformPoint(
                       Bezier.GetPoint2(points[i], points[i + 1], points[i + 2], points[i + 3], t)));
        }
Пример #2
0
        public Vector3 GetPoint(float t)
        {
            Vector3 point = Bezier.GetPoint2(points[0], points[1], points[2], points[3], t);

            return(transform.TransformPoint(point));
        }