title: Corona/Box2D detect collision with non-moving static objects
body: <p>For posting reasons here's a simple version of what I'm trying to do.</p>
  
  <p>On the screen I have a simple circle object that is static and doesn't move. The user can then drag and drop a straight line. If the line passes through that circle I'm hoping for the collision event to be triggered.</p>
  
  <p>It appears that unless one of the objects are moving the collision is never detected. Can I detect the collision when the line is drawn?</p>
  
  <p>Collision Event</p>
  
  <pre><code>function onHit(e)
      print("hit");
  end
  Runtime:addEventListener("collision", onHit)
  </code></pre>
  
  <p>Touch Event</p>
  
  <pre><code>local startX = 0;
  local startY = 0;
  local endX = 0;
  local endY = 0;
  
  function onTouch(e)
      if(e.phase == "began") then
          startX = e.x
          startY = e.y
      elseif(e.phase == "moved") then
          endX = e.x
          endY = e.y
      elseif(e.phase == "ended") then
          local line = display.newLine(startX, startY, endX, endY)
          line:setColor(100, 100, 100)
          line.width = 2
          physics.addBody(line, "static", {   })
      end
  end
  Runtime:addEventListener("touch", onTouch)
  </code></pre>
  
  <p>Create circle</p>
  
  <pre><code>local c = display.newCircle(50, 50, 24)
  physics.addBody(c, "static", { radius = 24 })
  </code></pre>