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;
}
}
}
}