BEPUutilities.ConvexHullHelper.VerifyWindings C# (CSharp) Method

VerifyWindings() private static method

private static VerifyWindings ( RawList newIndices, RawList points, Vector3 &centroid ) : void
newIndices RawList
points RawList
centroid Vector3
return void
        private static void VerifyWindings(RawList<int> newIndices, RawList<Vector3> points, ref Vector3 centroid)
        {
            //Go through every triangle.
            for (int k = 0; k < newIndices.Count; k += 3)
            {
                //Check if the triangle faces away or towards the centroid.

                if (IsTriangleVisibleFromPoint(newIndices, points, k, ref centroid))
                {
                    //If it's towards, flip the winding.
                    int temp = newIndices[k + 1];
                    newIndices[k + 1] = newIndices[k + 2];
                    newIndices[k + 2] = temp;
                }
            }
        }
    }