     @velocity = opts.velocity or @velocity
     @angularVelocity = opts.angularVelocity or @angularVelocity
 
-    @inverseMass = opts.inverseMass or 0
-    @inverseMoment = opts.inverseMoment or @calculateInverseMoment(sizeX, sizeY)
+    @calculatePhysicalProperties opts
 
   reset: ->
     # TODO only reset if position/velocity/orientation have changed

    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, opts = {}) ->
    @position = position
    @offsets = [[ sizeX/2,  sizeY/2],
               [-sizeX/2,  sizeY/2],
               [-sizeX/2, -sizeY/2],

  window.grid = new Grid 100, "#056"
  controls = new KeyboardControls

  window.rect = new Rectangle 2, 2,
    position: [0, 0]
    inverseMass: 1/1
    color: "#F00"

  paused = false

