示例#1
0
            public bool Test(int2 h, int2 p, ref float t)
            {
                TessEdgeCompare tc = new TessEdgeCompare();

                t = tc.Compare(h, p);
                return(t == 0);
            }
示例#2
0
            static int GetEqualHullForEdges(NativeArray <TessEdge> edges, TessEdge p)
            {
                int             l   = 0;
                int             h   = edges.Length - 1;
                TessEdgeCompare tec = new TessEdgeCompare();

                while (l <= h)
                {
                    int m;
                    m = ((int)(l + h)) >> 1;
                    int f = tec.Compare(edges[m], p);
                    if (f == 0)
                    {
                        return(m);
                    }
                    else if (f <= 0)
                    {
                        l = m + 1;
                    }
                    else
                    {
                        h = m - 1;
                    }
                }

                return(-1);
            }
示例#3
0
        static void InsertUniqueEdge(NativeArray <int2> edges, int2 e, ref int edgeCount)
        {
            TessEdgeCompare edgeComparer = new TessEdgeCompare();
            var             validEdge    = true;

            for (int j = 0; validEdge && j < edgeCount; ++j)
            {
                if (edgeComparer.Compare(e, edges[j]) == 0)
                {
                    validEdge = false;
                }
            }
            if (validEdge)
            {
                edges[edgeCount++] = e;
            }
        }