example/Asteroid.js
function wrap(body) {
    var p = body.getPosition();
    p.x = wrapNumber(p.x, -SPACE_WIDTH / 2, SPACE_WIDTH / 2);
    p.y = wrapNumber(p.y, -SPACE_HEIGHT / 2, SPACE_HEIGHT / 2);
    body.setPosition(p);
  }
function wrap(body) {
    var p = body.getPosition();
    p.x = wrapNumber(p.x, -SPACE_WIDTH / 2, SPACE_WIDTH / 2);
    p.y = wrapNumber(p.y, -SPACE_HEIGHT / 2, SPACE_HEIGHT / 2);
    body.setPosition(p);
  }
function wrap ( body ) { var p = body . getPosition ( ) ; p . x = wrapNumber ( p . x , - SPACE_WIDTH / 2 , SPACE_WIDTH / 2 ) ; p . y = wrapNumber ( p . y , - SPACE_HEIGHT / 2 , SPACE_HEIGHT / 2 ) ; body . setPosition ( p ) ; }
If the body is out of space bounds, wrap it to the other side
If the body is out of space bounds wrap it to the other side