Esempio n. 1
0
        static public void DrawFill(ShapeFill shape)
        {
            Vector2  pointInWorld;
            Vector2D pointInWorld2D = Vector2D.Zero();

            foreach (Vector2D point in shape.pointsIn)
            {
                pointInWorld = shape.transform.TransformPoint(point.ToVector2());

                pointInWorld2D.x = pointInWorld.x;
                pointInWorld2D.y = pointInWorld.y;

                if (ShapeObject.PointInShapes(pointInWorld2D) == false)
                {
                    ShapeDraw.Draw(pointInWorld, shape.transform);
                }
            }
        }
Esempio n. 2
0
        public static void DrawMatch(ShapeObject shapeA, ShapeObject shapeB)
        {
            Vector2   pointInWorld;
            Vector2D  pointInWorld2D = Vector2D.Zero();
            Polygon2D polyInWorld;

            foreach (Vector2D point in shapeA.pointsIn)
            {
                pointInWorld = shapeA.transform.TransformPoint(point.ToVector2());

                pointInWorld2D.x = pointInWorld.x;
                pointInWorld2D.y = pointInWorld.y;

                polyInWorld = shapeB.GetWorldPolygon();

                if (polyInWorld.PointInPoly(pointInWorld2D))
                {
                    ShapeDraw.Draw(pointInWorld, shapeA.transform);
                }
            }

            foreach (Vector2D point in shapeB.pointsIn)
            {
                pointInWorld = shapeB.transform.TransformPoint(point.ToVector2());

                pointInWorld2D.x = pointInWorld.x;
                pointInWorld2D.y = pointInWorld.y;

                polyInWorld = shapeA.GetWorldPolygon();

                if (polyInWorld.PointInPoly(pointInWorld2D))
                {
                    ShapeDraw.Draw(pointInWorld, shapeB.transform);
                }
            }
        }