Exemplo n.º 1
0
    private void CreateNewHulls(UvMapper uvMapper, Vector3[] points, Vector3[] normals, out IList <IHull> newHulls)
    {
        newHulls = new List <IHull>();

        // Add the starting hull
        newHulls.Add(hull);

        for (int j = 0; j < points.Length; j++)
        {
            int previousHullCount = newHulls.Count;

            for (int i = 0; i < previousHullCount; i++)
            {
                IHull previousHull = newHulls[0];

                // Split the previous hull
                IHull a, b;

                previousHull.Split(points[j], normals[j], fillCut, uvMapper, out a, out b);

                // Update the list
                newHulls.Remove(previousHull);

                if (!a.IsEmpty)
                {
                    newHulls.Add(a);
                }

                if (!b.IsEmpty)
                {
                    newHulls.Add(b);
                }
            }
        }
    }