CalculateRanges() public static method

public static CalculateRanges ( float minTime, float maxTime, float rangeStart, float rangeEnd, WrapMode preWrapMode, WrapMode postWrapMode ) : ].float[
minTime float
maxTime float
rangeStart float
rangeEnd float
preWrapMode WrapMode
postWrapMode WrapMode
return ].float[
        private Vector3[] GetPoints(float minTime, float maxTime)
        {
            List <Vector3> list = new List <Vector3>();

            if (this.m_Curve.length == 0)
            {
                return(list.ToArray());
            }
            list.Capacity  = 1000 + this.m_Curve.length;
            float[,] array = NormalCurveRenderer.CalculateRanges(minTime, maxTime, this.rangeStart, this.rangeEnd, this.preWrapMode, this.postWrapMode);
            for (int i = 0; i < array.GetLength(0); i++)
            {
                this.AddPoints(ref list, array[i, 0], array[i, 1], minTime, maxTime);
            }
            if (list.Count > 0)
            {
                for (int j = 1; j < list.Count; j++)
                {
                    if (list[j].x < list[j - 1].x)
                    {
                        list.RemoveAt(j);
                        j--;
                    }
                }
            }
            return(list.ToArray());
        }
Beispiel #2
0
        private Vector3[] GetPoints(float minTime, float maxTime)
        {
            List <Vector3> points = new List <Vector3>();

            if (this.m_Curve.length == 0)
            {
                return(points.ToArray());
            }
            points.Capacity = 1000 + this.m_Curve.length;
            float[,] ranges = NormalCurveRenderer.CalculateRanges(minTime, maxTime, this.rangeStart, this.rangeEnd, this.preWrapMode, this.postWrapMode);
            for (int index = 0; index < ranges.GetLength(0); ++index)
            {
                this.AddPoints(ref points, ranges[index, 0], ranges[index, 1], minTime, maxTime);
            }
            if (points.Count > 0)
            {
                for (int index = 1; index < points.Count; ++index)
                {
                    if ((double)points[index].x < (double)points[index - 1].x)
                    {
                        points.RemoveAt(index);
                        --index;
                    }
                }
            }
            return(points.ToArray());
        }
Beispiel #3
0
 private void CalculateCurves(float minTime, float maxTime)
 {
     this.points     = new SortedDictionary <float, Vector3>();
     float[,] ranges = NormalCurveRenderer.CalculateRanges(minTime, maxTime, this.rangeStart, this.rangeEnd, this.preWrapMode, this.postWrapMode);
     for (int index = 0; index < ranges.GetLength(0); ++index)
     {
         this.AddPoints(ranges[index, 0], ranges[index, 1]);
     }
 }
Beispiel #4
0
 private void CalculateCurves(float minTime, float maxTime)
 {
     this.points    = new SortedDictionary <float, Vector3>();
     float[,] array = NormalCurveRenderer.CalculateRanges(minTime, maxTime, this.rangeStart, this.rangeEnd, this.preWrapMode, this.postWrapMode);
     for (int i = 0; i < array.GetLength(0); i++)
     {
         this.AddPoints(array[i, 0], array[i, 1]);
     }
 }
Beispiel #5
0
        private void CalculateCurves(float minTime, float maxTime)
        {
            points = new SortedDictionary <float, Vector3>();

            float[,] ranges = NormalCurveRenderer.CalculateRanges(minTime, maxTime, rangeStart, rangeEnd, preWrapMode, postWrapMode);
            for (int i = 0; i < ranges.GetLength(0); i++)
            {
                AddPoints(ranges[i, 0], ranges[i, 1]);
            }
        }