BEPUphysics.BroadPhaseSystems.SortAndSweep.SortAndSweep1D.SortSection C# (CSharp) Метод

SortSection() публичный Метод

public SortSection ( int section ) : void
section int
Результат void
        void SortSection(int section)
        {
            int intervalLength = entries.Count / sortSegmentCount;
            int start = section * intervalLength;
            int end;
            if (section == sortSegmentCount - 1)
                end = entries.Count;
            else
                end = intervalLength * (section + 1);

            for (int i = start + 1; i < end; i++)
            {
                var entry = entries.Elements[i];
                for (int j = i - 1; j >= 0; j--)
                {
                    if (entry.boundingBox.Min.X < entries.Elements[j].boundingBox.Min.X)
                    {
                        entries.Elements[j + 1] = entries.Elements[j];
                        entries.Elements[j] = entry;
                    }
                    else
                        break;
                }

            }
        }