Beispiel #1
0
        public static Polygons CreateFromString(string polygonsPackedString)
        {
            Polygons output = new Polygons();

            string[] polygons = polygonsPackedString.Split('|');
            foreach (string polygonString in polygons)
            {
                Polygon nextPoly = PolygonHelper.CreateFromString(polygonString);
                if (nextPoly.Count > 0)
                {
                    output.Add(nextPoly);
                }
            }
            return(output);
        }
        public static bool polygonCollidesWithlineSegment(Polygons polys, IntPoint transformed_startPoint, IntPoint transformed_endPoint, PointMatrix transformation_matrix)
        {
            foreach (Polygon poly in polys)
            {
                if (poly.size() == 0)
                {
                    continue;
                }
                if (PolygonHelper.polygonCollidesWithlineSegment(poly, transformed_startPoint, transformed_endPoint, transformation_matrix))
                {
                    return(true);
                }
            }

            return(false);
        }