src/system.js
function (body) {
    var driver = this.driver;

    body.__applyImpulse = body.applyImpulse;
    body.applyImpulse = function () {
      driver.applyBodyMethod(body, 'applyImpulse', arguments);
    };

    body.__applyForce = body.applyForce;
    body.applyForce = function () {
      driver.applyBodyMethod(body, 'applyForce', arguments);
    };

    body.updateProperties = function () {
      driver.updateBodyProperties(body);
    };

    this.listeners[body.id] = function (e) { body.el.emit('collide', e); };
    body.addEventListener('collide', this.listeners[body.id]);

    this.driver.addBody(body);
  }
function (body) {
    var driver = this.driver;

    body.__applyImpulse = body.applyImpulse;
    body.applyImpulse = function () {
      driver.applyBodyMethod(body, 'applyImpulse', arguments);
    };

    body.__applyForce = body.applyForce;
    body.applyForce = function () {
      driver.applyBodyMethod(body, 'applyForce', arguments);
    };

    body.updateProperties = function () {
      driver.updateBodyProperties(body);
    };

    this.listeners[body.id] = function (e) { body.el.emit('collide', e); };
    body.addEventListener('collide', this.listeners[body.id]);

    this.driver.addBody(body);
  }
function ( body ) { var driver = this . driver ; body . __applyImpulse = body . applyImpulse ; body . applyImpulse = function ( ) { driver . applyBodyMethod ( body , 'applyImpulse' , arguments ) ; } ; body . __applyForce = body . applyForce ; body . applyForce = function ( ) { driver . applyBodyMethod ( body , 'applyForce' , arguments ) ; } ; body . updateProperties = function ( ) { driver . updateBodyProperties ( body ) ; } ; this . listeners [ body . id ] = function ( e ) { body . el . emit ( 'collide' , e ) ; } ; body . addEventListener ( 'collide' , this . listeners [ body . id ] ) ; this . driver . addBody ( body ) ; }
Adds a body to the scene, and binds proxied methods to the driver.
@param {CANNON.Body} body
Adds a body to the scene and binds proxied methods to the driver .