示例#1
0
 public void Draw()
 {
     if (Flags.ShowCollisionRecs)
     {
         foreach (var collisionComponent in _collisionComponents)
         {
             if (!collisionComponent.Inactive)
             {
                 Functions_Draw.DrawDebug(collisionComponent.CollisionRectangle);
                 Functions_Draw.DrawDebug(collisionComponent.CollisionRectangle.Center);
             }
         }
         //collision.DrawMinkowski();
     }
     if (Flags.ShowMovementCenters)
     {
         foreach (var movementComponent in _movementComponents)
         {
             if (!movementComponent.Inactive)
             {
                 Functions_Draw.DrawDebug(movementComponent.Position, Color.Yellow);
             }
         }
     }
 }
示例#2
0
 public void DrawMinkowski()
 {
     foreach (var actor in _moveableCollisionComponents)
     {
         if (actor.Collision.Inactive)
         {
             continue;
         }
         foreach (var target in _collisionComponents)
         {
             if (target.Inactive)
             {
                 continue;
             }
             if (actor.Movement.IsMoving && !actor.Collision.Equals(target))
             {
                 Functions_Draw.DrawDebug(CollisionPhysicsSubsystem.CalculateMinkowskiDifference(actor.Collision.CollisionRectangle, target.CollisionRectangle));
             }
         }
     }
 }