Example #1
0
        public int ClipStart(Slot slot, ClippingAttachment clip)
        {
            if (clipAttachment != null)
            {
                return(0);
            }
            clipAttachment = clip;
            int worldVerticesLength = clip.worldVerticesLength;

            float[] items = clippingPolygon.Resize(worldVerticesLength).Items;
            clip.ComputeWorldVertices(slot, 0, worldVerticesLength, items, 0);
            MakeClockwise(clippingPolygon);
            clippingPolygons = triangulator.Decompose(clippingPolygon, triangulator.Triangulate(clippingPolygon));
            foreach (ExposedList <float> clippingPolygon2 in clippingPolygons)
            {
                MakeClockwise(clippingPolygon2);
                clippingPolygon2.Add(clippingPolygon2.Items[0]);
                clippingPolygon2.Add(clippingPolygon2.Items[1]);
            }
            return(clippingPolygons.Count);
        }