Пример #1
0
 private static bool PointInSimplex(TSVector2 point, YuPengClipper.Edge edge)
 {
     return(new Vertices
     {
         TSVector2.zero,
         edge.EdgeStart,
         edge.EdgeEnd
     }.PointInPolygon(ref point) == 1);
 }
Пример #2
0
        private static FP CalculateBeta(TSVector2 point, YuPengClipper.Edge e, FP coefficient)
        {
            FP   result = 0f;
            bool flag   = YuPengClipper.PointInSimplex(point, e);

            if (flag)
            {
                result = coefficient;
            }
            bool flag2 = YuPengClipper.PointOnLineSegment(TSVector2.zero, e.EdgeStart, point) || YuPengClipper.PointOnLineSegment(TSVector2.zero, e.EdgeEnd, point);

            if (flag2)
            {
                result = 0.5f * coefficient;
            }
            return(result);
        }
Пример #3
0
            public bool Equals(YuPengClipper.Edge e)
            {
                bool flag = e == null;

                return(!flag && YuPengClipper.VectorEqual(this.EdgeStart, e.EdgeStart) && YuPengClipper.VectorEqual(this.EdgeEnd, e.EdgeEnd));
            }