diff --git a/src/collision/Collision.js b/src/collision/Collision.js new file mode 100644 index 0000000..ef53a7d --- /dev/null +++ b/src/collision/Collision.js @@ -0,0 +1,36 @@ +/** +* The `Matter.Collision` module contains methods for managing collision records. +* +* @class Collision +*/ + +var Collision = {}; + +module.exports = Collision; + +(function() { + + /** + * Creates a new collision record. + * @method create + * @param {body} bodyA + * @param {body} bodyB + * @return {collision} A new collision record + */ + Collision.create = function(bodyA, bodyB) { + return { + pair: null, + collided: false, + bodyA: bodyA, + bodyB: bodyB, + parentA: bodyA.parent, + parentB: bodyB.parent, + depth: 0, + normal: { x: 0, y: 0 }, + tangent: { x: 0, y: 0 }, + penetration: { x: 0, y: 0 }, + supports: [] + }; + }; + +})();