Beispiel #1
0
 public void Update()
 {
     if (visualisation == true)
     {
         ShapeDraw.DrawFill(this);
     }
 }
 public void Update()
 {
     if (ShapeMatchType.World == type)
     {
         if (visualisation == true)
         {
             ShapeDraw.DrawMatch(shapeA, shapeB);
         }
     }
 }
Beispiel #3
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);
                }
            }
        }
Beispiel #4
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);
                }
            }
        }