 
   window.world = new World "physics"
 
-  window.rect = new Rectangle 2, 2,
+  window.rect = new Rectangle 5, 2,
     position: [0, -1]
-    inverseMass: 1/4
     inverseMass: 0
-    velocity: [0, 0.0001]
     # angularVelocity: Math.PI/4
     color: "#F00"
 
   window.rect2 = new Rectangle 1, 1,
     position: [0,0.5]
-    angle: 0.2
     inverseMass: 1/1
-    # velocity: [0, -1.5]
     # angularVelocity: -Math.PI/2
+    acceleration: [0, -2]
     color: "#08F"
 
-  world.addObject rect
-  world.addObject rect2
+  world.addBody rect
+  world.addBody rect2
+
+window.debug = (msgs...) ->
+  # console.log msgs...
 
 class World
   constructor: (element) ->

      impulse = Vec.invert impulse
      @to.applyImpulse impulse, @position

    console.log "sepV is now", @separatingVelocity()

  resolveInterpenetration: ->
    return if @depth <= 0


      # @paused = true

  # Naive version: returns all unique pairs of bodies, nothing more. TODO: use
  # (memoized?) AABBs to build quadtree, then iterate and compare bounding boxes
  # for overlap.
  broadPhaseCollisions: ->
    pairs = []
    for i in [0..(@bodies.length-2)]
      for j in [(i+1)..(@bodies.length-1)]
        pairs.push [@bodies[i], @bodies[j]]
    pairs

  narrowPhaseCollisions: (pairs) ->
