UnityEditor.Timeline.GetPivotVectors C# (CSharp) Method

GetPivotVectors() private method

private GetPivotVectors ( PivotSample samples, float width, Rect rect, float height, bool loop ) : Vector3[]
samples PivotSample
width float
rect UnityEngine.Rect
height float
loop bool
return Vector3[]
        private Vector3[] GetPivotVectors(PivotSample[] samples, float width, Rect rect, float height, bool loop)
        {
            if ((samples.Length == 0) || (width < 0.33f))
            {
                return new Vector3[0];
            }
            List<Vector3> segmentPoints = new List<Vector3>();
            for (int i = 0; i < samples.Length; i++)
            {
                PivotSample sample = samples[i];
                Vector3 zero = Vector3.zero;
                zero.x = this.m_TimeArea.TimeToPixel(sample.m_Time, rect);
                zero.y = (height / 16f) + (((sample.m_Weight * 12f) * height) / 16f);
                segmentPoints.Add(zero);
            }
            if (loop)
            {
                Vector3 vector2 = segmentPoints[segmentPoints.Count - 1];
                if (vector2.x <= rect.width)
                {
                    Vector3 vector3 = segmentPoints[segmentPoints.Count - 1];
                    float x = vector3.x;
                    int num3 = 0;
                    int num4 = 1;
                    List<Vector3> collection = new List<Vector3>();
                    while (x < rect.width)
                    {
                        if (num3 > (segmentPoints.Count - 1))
                        {
                            num3 = 0;
                            num4++;
                        }
                        Vector3 item = segmentPoints[num3];
                        item.x += num4 * width;
                        x = item.x;
                        collection.Add(item);
                        num3++;
                    }
                    segmentPoints.AddRange(collection);
                }
            }
            List<Vector3> controls = this.GetControls(segmentPoints, 0.5f);
            segmentPoints.Clear();
            for (int j = 0; j < (controls.Count - 3); j += 3)
            {
                Vector3 vector5 = controls[j];
                Vector3 vector6 = controls[j + 1];
                Vector3 vector7 = controls[j + 2];
                Vector3 vector8 = controls[j + 3];
                if (j == 0)
                {
                    segmentPoints.Add(this.CalculatePoint(0f, vector5, vector6, vector7, vector8));
                }
                for (int k = 1; k <= 10; k++)
                {
                    segmentPoints.Add(this.CalculatePoint(((float) k) / 10f, vector5, vector6, vector7, vector8));
                }
            }
            return segmentPoints.ToArray();
        }