src/collisions/src/collision-handler.js
function _recordCollisions(collidable, collidingCollidables, elapsedTime) {
  return collidingCollidables.map(other => {
    const collision = {
      collidableA: collidable,
      collidableB: other,
      time: elapsedTime
    };

    // Record the fact that these objects collided (the ModelController may want to handle this).
    collision.collidableA.collisions.push(collision);
    collision.collidableB.collisions.push(collision);

    return collision;
  });
}
function _recordCollisions(collidable, collidingCollidables, elapsedTime) {
  return collidingCollidables.map(other => {
    const collision = {
      collidableA: collidable,
      collidableB: other,
      time: elapsedTime
    };

    // Record the fact that these objects collided (the ModelController may want to handle this).
    collision.collidableA.collisions.push(collision);
    collision.collidableB.collisions.push(collision);

    return collision;
  });
}
function _recordCollisions ( collidable , collidingCollidables , elapsedTime ) { return collidingCollidables . map ( other => { const collision = { collidableA : collidable , collidableB : other , time : elapsedTime } ; // Record the fact that these objects collided (the ModelController may want to handle this). collision . collidableA . collisions . push ( collision ) ; collision . collidableB . collisions . push ( collision ) ; return collision ; } ) ; }
Create collision objects that record the time of collision and the collidables in the collision.

Also record references to these collisions on the collidables.

@param {Collidable} collidable
@param {Array.<Collidable>} collidingCollidables
@param {DOMHighResTimeStamp} elapsedTime
@returns {Array.<Collision>}
@private
Create collision objects that record the time of collision and the collidables in the collision .