   perpendicularAxes: ->
     for pair in Utils.pairs @points()
       Vec.perpendicular Vec.sub pair[1], pair[0]
+
+  perpendicularAxesFacing: (other) ->
+    dir = Vec.sub other.position, @position
+    (axis for axis in @perpendicularAxes() when Vec.dotProduct(axis, dir) > 0)
 
 class Rectangle extends Polygon
   constructor: (sizeX, sizeY, position, angle, @color) ->

        minOverlap = overlap
        minAxis = axis

    for axis in other.perpendicularAxes()
      us = @projectionInterval axis
      them = other.projectionInterval axis
      overlap = Utils.intervalOverlap us, them

    console.log "found minimum separation axis of #{minAxis}"
    return [] unless minAxis

    @debug.myBest = e1 = @bestEdge minAxis
    @debug.theirBest = e2 = other.bestEdge Vec.invert minAxis # A->B always

    # Now, clip the edges. Do a series of line/plane clips to get the contact
    # manifold. Identify the reference edge and incident edge. Reference is most
