0
0
Fork 0
mirror of https://github.com/liabru/matter-js.git synced 2025-01-15 16:38:43 -05:00

release 0.11.1

This commit is contained in:
liabru 2016-11-09 20:46:45 +00:00
parent ded796c93f
commit 422c1e4dff
6 changed files with 173 additions and 165 deletions

View file

@ -1,3 +1,11 @@
<a name="0.11.1"></a>
## 0.11.1 (2016-11-09)
* added derequire to build ([ded796c](https://github.com/liabru/matter-js/commit/ded796c))
<a name="0.11.0"></a> <a name="0.11.0"></a>
# 0.11.0 (2016-11-04) # 0.11.0 (2016-11-04)

View file

@ -237,7 +237,7 @@ var serve = function(isTest) {
}; };
var build = function(options) { var build = function(options) {
var isDev = options.version.indexOf('-dev'), var isDev = options.version.indexOf('-dev') !== -1,
filename = buildDirectory + (isDev ? '/matter-dev' : '/matter'), filename = buildDirectory + (isDev ? '/matter-dev' : '/matter'),
dest = filename + '.js', dest = filename + '.js',
destMin = filename + '.min.js'; destMin = filename + '.min.js';
@ -258,7 +258,7 @@ var build = function(options) {
.pipe(derequire()) .pipe(derequire())
.pipe(replace('@@VERSION@@', options.version)); .pipe(replace('@@VERSION@@', options.version));
if (isDev === -1) { if (!isDev) {
compiled.pipe(preprocess({ context: { DEBUG: false } })); compiled.pipe(preprocess({ context: { DEBUG: false } }));
} }

View file

@ -1,6 +1,6 @@
{ {
"name": "Matter", "name": "Matter",
"version": "0.11.0", "version": "0.11.1",
"homepage": "https://github.com/liabru/matter-js", "homepage": "https://github.com/liabru/matter-js",
"authors": [ "authors": [
"Liam Brummitt <liam@brm.io> (http://brm.io/)" "Liam Brummitt <liam@brm.io> (http://brm.io/)"

View file

@ -1,5 +1,5 @@
/** /**
* matter-js 0.11.0 by @liabru 2016-11-04 * matter-js 0.11.1 by @liabru 2016-11-09
* http://brm.io/matter-js/ * http://brm.io/matter-js/
* License MIT * License MIT
*/ */
@ -28,7 +28,7 @@
* THE SOFTWARE. * THE SOFTWARE.
*/ */
(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.Matter = f()}})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){ (function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.Matter = f()}})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(_dereq_,module,exports){
/** /**
* The `Matter.Body` module contains methods for creating and manipulating body models. * The `Matter.Body` module contains methods for creating and manipulating body models.
* A `Matter.Body` is a rigid body that can be simulated by a `Matter.Engine`. * A `Matter.Body` is a rigid body that can be simulated by a `Matter.Engine`.
@ -43,13 +43,13 @@ var Body = {};
module.exports = Body; module.exports = Body;
var Vertices = require('../geometry/Vertices'); var Vertices = _dereq_('../geometry/Vertices');
var Vector = require('../geometry/Vector'); var Vector = _dereq_('../geometry/Vector');
var Sleeping = require('../core/Sleeping'); var Sleeping = _dereq_('../core/Sleeping');
var Render = require('../render/Render'); var Render = _dereq_('../render/Render');
var Common = require('../core/Common'); var Common = _dereq_('../core/Common');
var Bounds = require('../geometry/Bounds'); var Bounds = _dereq_('../geometry/Bounds');
var Axes = require('../geometry/Axes'); var Axes = _dereq_('../geometry/Axes');
(function() { (function() {
@ -1160,7 +1160,7 @@ var Axes = require('../geometry/Axes');
})(); })();
},{"../core/Common":14,"../core/Sleeping":22,"../geometry/Axes":25,"../geometry/Bounds":26,"../geometry/Vector":28,"../geometry/Vertices":29,"../render/Render":31}],2:[function(require,module,exports){ },{"../core/Common":14,"../core/Sleeping":22,"../geometry/Axes":25,"../geometry/Bounds":26,"../geometry/Vector":28,"../geometry/Vertices":29,"../render/Render":31}],2:[function(_dereq_,module,exports){
/** /**
* The `Matter.Composite` module contains methods for creating and manipulating composite bodies. * The `Matter.Composite` module contains methods for creating and manipulating composite bodies.
* A composite body is a collection of `Matter.Body`, `Matter.Constraint` and other `Matter.Composite`, therefore composites form a tree structure. * A composite body is a collection of `Matter.Body`, `Matter.Constraint` and other `Matter.Composite`, therefore composites form a tree structure.
@ -1176,9 +1176,9 @@ var Composite = {};
module.exports = Composite; module.exports = Composite;
var Events = require('../core/Events'); var Events = _dereq_('../core/Events');
var Common = require('../core/Common'); var Common = _dereq_('../core/Common');
var Body = require('./Body'); var Body = _dereq_('./Body');
(function() { (function() {
@ -1820,7 +1820,7 @@ var Body = require('./Body');
})(); })();
},{"../core/Common":14,"../core/Events":16,"./Body":1}],3:[function(require,module,exports){ },{"../core/Common":14,"../core/Events":16,"./Body":1}],3:[function(_dereq_,module,exports){
/** /**
* The `Matter.World` module contains methods for creating and manipulating the world composite. * The `Matter.World` module contains methods for creating and manipulating the world composite.
* A `Matter.World` is a `Matter.Composite` body, which is a collection of `Matter.Body`, `Matter.Constraint` and other `Matter.Composite`. * A `Matter.World` is a `Matter.Composite` body, which is a collection of `Matter.Body`, `Matter.Constraint` and other `Matter.Composite`.
@ -1838,9 +1838,9 @@ var World = {};
module.exports = World; module.exports = World;
var Composite = require('./Composite'); var Composite = _dereq_('./Composite');
var Constraint = require('../constraint/Constraint'); var Constraint = _dereq_('../constraint/Constraint');
var Common = require('../core/Common'); var Common = _dereq_('../core/Common');
(function() { (function() {
@ -1952,7 +1952,7 @@ var Common = require('../core/Common');
})(); })();
},{"../constraint/Constraint":12,"../core/Common":14,"./Composite":2}],4:[function(require,module,exports){ },{"../constraint/Constraint":12,"../core/Common":14,"./Composite":2}],4:[function(_dereq_,module,exports){
/** /**
* The `Matter.Contact` module contains methods for creating and manipulating collision contacts. * The `Matter.Contact` module contains methods for creating and manipulating collision contacts.
* *
@ -1992,7 +1992,7 @@ module.exports = Contact;
})(); })();
},{}],5:[function(require,module,exports){ },{}],5:[function(_dereq_,module,exports){
/** /**
* The `Matter.Detector` module contains methods for detecting collisions given a set of pairs. * The `Matter.Detector` module contains methods for detecting collisions given a set of pairs.
* *
@ -2005,9 +2005,9 @@ var Detector = {};
module.exports = Detector; module.exports = Detector;
var SAT = require('./SAT'); var SAT = _dereq_('./SAT');
var Pair = require('./Pair'); var Pair = _dereq_('./Pair');
var Bounds = require('../geometry/Bounds'); var Bounds = _dereq_('../geometry/Bounds');
(function() { (function() {
@ -2087,7 +2087,7 @@ var Bounds = require('../geometry/Bounds');
})(); })();
},{"../geometry/Bounds":26,"./Pair":7,"./SAT":11}],6:[function(require,module,exports){ },{"../geometry/Bounds":26,"./Pair":7,"./SAT":11}],6:[function(_dereq_,module,exports){
/** /**
* The `Matter.Grid` module contains methods for creating and manipulating collision broadphase grid structures. * The `Matter.Grid` module contains methods for creating and manipulating collision broadphase grid structures.
* *
@ -2098,9 +2098,9 @@ var Grid = {};
module.exports = Grid; module.exports = Grid;
var Pair = require('./Pair'); var Pair = _dereq_('./Pair');
var Detector = require('./Detector'); var Detector = _dereq_('./Detector');
var Common = require('../core/Common'); var Common = _dereq_('../core/Common');
(function() { (function() {
@ -2403,7 +2403,7 @@ var Common = require('../core/Common');
})(); })();
},{"../core/Common":14,"./Detector":5,"./Pair":7}],7:[function(require,module,exports){ },{"../core/Common":14,"./Detector":5,"./Pair":7}],7:[function(_dereq_,module,exports){
/** /**
* The `Matter.Pair` module contains methods for creating and manipulating collision pairs. * The `Matter.Pair` module contains methods for creating and manipulating collision pairs.
* *
@ -2414,7 +2414,7 @@ var Pair = {};
module.exports = Pair; module.exports = Pair;
var Contact = require('./Contact'); var Contact = _dereq_('./Contact');
(function() { (function() {
@ -2531,7 +2531,7 @@ var Contact = require('./Contact');
})(); })();
},{"./Contact":4}],8:[function(require,module,exports){ },{"./Contact":4}],8:[function(_dereq_,module,exports){
/** /**
* The `Matter.Pairs` module contains methods for creating and manipulating collision pair sets. * The `Matter.Pairs` module contains methods for creating and manipulating collision pair sets.
* *
@ -2542,8 +2542,8 @@ var Pairs = {};
module.exports = Pairs; module.exports = Pairs;
var Pair = require('./Pair'); var Pair = _dereq_('./Pair');
var Common = require('../core/Common'); var Common = _dereq_('../core/Common');
(function() { (function() {
@ -2689,7 +2689,7 @@ var Common = require('../core/Common');
})(); })();
},{"../core/Common":14,"./Pair":7}],9:[function(require,module,exports){ },{"../core/Common":14,"./Pair":7}],9:[function(_dereq_,module,exports){
/** /**
* The `Matter.Query` module contains methods for performing collision queries. * The `Matter.Query` module contains methods for performing collision queries.
* *
@ -2702,11 +2702,11 @@ var Query = {};
module.exports = Query; module.exports = Query;
var Vector = require('../geometry/Vector'); var Vector = _dereq_('../geometry/Vector');
var SAT = require('./SAT'); var SAT = _dereq_('./SAT');
var Bounds = require('../geometry/Bounds'); var Bounds = _dereq_('../geometry/Bounds');
var Bodies = require('../factory/Bodies'); var Bodies = _dereq_('../factory/Bodies');
var Vertices = require('../geometry/Vertices'); var Vertices = _dereq_('../geometry/Vertices');
(function() { (function() {
@ -2803,7 +2803,7 @@ var Vertices = require('../geometry/Vertices');
})(); })();
},{"../factory/Bodies":23,"../geometry/Bounds":26,"../geometry/Vector":28,"../geometry/Vertices":29,"./SAT":11}],10:[function(require,module,exports){ },{"../factory/Bodies":23,"../geometry/Bounds":26,"../geometry/Vector":28,"../geometry/Vertices":29,"./SAT":11}],10:[function(_dereq_,module,exports){
/** /**
* The `Matter.Resolver` module contains methods for resolving collision pairs. * The `Matter.Resolver` module contains methods for resolving collision pairs.
* *
@ -2814,10 +2814,10 @@ var Resolver = {};
module.exports = Resolver; module.exports = Resolver;
var Vertices = require('../geometry/Vertices'); var Vertices = _dereq_('../geometry/Vertices');
var Vector = require('../geometry/Vector'); var Vector = _dereq_('../geometry/Vector');
var Common = require('../core/Common'); var Common = _dereq_('../core/Common');
var Bounds = require('../geometry/Bounds'); var Bounds = _dereq_('../geometry/Bounds');
(function() { (function() {
@ -3149,7 +3149,7 @@ var Bounds = require('../geometry/Bounds');
})(); })();
},{"../core/Common":14,"../geometry/Bounds":26,"../geometry/Vector":28,"../geometry/Vertices":29}],11:[function(require,module,exports){ },{"../core/Common":14,"../geometry/Bounds":26,"../geometry/Vector":28,"../geometry/Vertices":29}],11:[function(_dereq_,module,exports){
/** /**
* The `Matter.SAT` module contains methods for detecting collisions using the Separating Axis Theorem. * The `Matter.SAT` module contains methods for detecting collisions using the Separating Axis Theorem.
* *
@ -3162,8 +3162,8 @@ var SAT = {};
module.exports = SAT; module.exports = SAT;
var Vertices = require('../geometry/Vertices'); var Vertices = _dereq_('../geometry/Vertices');
var Vector = require('../geometry/Vector'); var Vector = _dereq_('../geometry/Vector');
(function() { (function() {
@ -3416,7 +3416,7 @@ var Vector = require('../geometry/Vector');
})(); })();
},{"../geometry/Vector":28,"../geometry/Vertices":29}],12:[function(require,module,exports){ },{"../geometry/Vector":28,"../geometry/Vertices":29}],12:[function(_dereq_,module,exports){
/** /**
* The `Matter.Constraint` module contains methods for creating and manipulating constraints. * The `Matter.Constraint` module contains methods for creating and manipulating constraints.
* Constraints are used for specifying that a fixed distance must be maintained between two bodies (or a body and a fixed world-space position). * Constraints are used for specifying that a fixed distance must be maintained between two bodies (or a body and a fixed world-space position).
@ -3439,12 +3439,12 @@ var Constraint = {};
module.exports = Constraint; module.exports = Constraint;
var Vertices = require('../geometry/Vertices'); var Vertices = _dereq_('../geometry/Vertices');
var Vector = require('../geometry/Vector'); var Vector = _dereq_('../geometry/Vector');
var Sleeping = require('../core/Sleeping'); var Sleeping = _dereq_('../core/Sleeping');
var Bounds = require('../geometry/Bounds'); var Bounds = _dereq_('../geometry/Bounds');
var Axes = require('../geometry/Axes'); var Axes = _dereq_('../geometry/Axes');
var Common = require('../core/Common'); var Common = _dereq_('../core/Common');
(function() { (function() {
@ -3812,7 +3812,7 @@ var Common = require('../core/Common');
})(); })();
},{"../core/Common":14,"../core/Sleeping":22,"../geometry/Axes":25,"../geometry/Bounds":26,"../geometry/Vector":28,"../geometry/Vertices":29}],13:[function(require,module,exports){ },{"../core/Common":14,"../core/Sleeping":22,"../geometry/Axes":25,"../geometry/Bounds":26,"../geometry/Vector":28,"../geometry/Vertices":29}],13:[function(_dereq_,module,exports){
/** /**
* The `Matter.MouseConstraint` module contains methods for creating mouse constraints. * The `Matter.MouseConstraint` module contains methods for creating mouse constraints.
* Mouse constraints are used for allowing user interaction, providing the ability to move bodies via the mouse or touch. * Mouse constraints are used for allowing user interaction, providing the ability to move bodies via the mouse or touch.
@ -3826,15 +3826,15 @@ var MouseConstraint = {};
module.exports = MouseConstraint; module.exports = MouseConstraint;
var Vertices = require('../geometry/Vertices'); var Vertices = _dereq_('../geometry/Vertices');
var Sleeping = require('../core/Sleeping'); var Sleeping = _dereq_('../core/Sleeping');
var Mouse = require('../core/Mouse'); var Mouse = _dereq_('../core/Mouse');
var Events = require('../core/Events'); var Events = _dereq_('../core/Events');
var Detector = require('../collision/Detector'); var Detector = _dereq_('../collision/Detector');
var Constraint = require('./Constraint'); var Constraint = _dereq_('./Constraint');
var Composite = require('../body/Composite'); var Composite = _dereq_('../body/Composite');
var Common = require('../core/Common'); var Common = _dereq_('../core/Common');
var Bounds = require('../geometry/Bounds'); var Bounds = _dereq_('../geometry/Bounds');
(function() { (function() {
@ -4075,7 +4075,7 @@ var Bounds = require('../geometry/Bounds');
})(); })();
},{"../body/Composite":2,"../collision/Detector":5,"../core/Common":14,"../core/Events":16,"../core/Mouse":19,"../core/Sleeping":22,"../geometry/Bounds":26,"../geometry/Vertices":29,"./Constraint":12}],14:[function(require,module,exports){ },{"../body/Composite":2,"../collision/Detector":5,"../core/Common":14,"../core/Events":16,"../core/Mouse":19,"../core/Sleeping":22,"../geometry/Bounds":26,"../geometry/Vertices":29,"./Constraint":12}],14:[function(_dereq_,module,exports){
/** /**
* The `Matter.Common` module contains utility functions that are common to all modules. * The `Matter.Common` module contains utility functions that are common to all modules.
* *
@ -4638,7 +4638,7 @@ module.exports = Common;
})(); })();
},{}],15:[function(require,module,exports){ },{}],15:[function(_dereq_,module,exports){
/** /**
* The `Matter.Engine` module contains methods for creating and manipulating engines. * The `Matter.Engine` module contains methods for creating and manipulating engines.
* An engine is a controller that manages updating the simulation of the world. * An engine is a controller that manages updating the simulation of the world.
@ -4653,18 +4653,18 @@ var Engine = {};
module.exports = Engine; module.exports = Engine;
var World = require('../body/World'); var World = _dereq_('../body/World');
var Sleeping = require('./Sleeping'); var Sleeping = _dereq_('./Sleeping');
var Resolver = require('../collision/Resolver'); var Resolver = _dereq_('../collision/Resolver');
var Render = require('../render/Render'); var Render = _dereq_('../render/Render');
var Pairs = require('../collision/Pairs'); var Pairs = _dereq_('../collision/Pairs');
var Metrics = require('./Metrics'); var Metrics = _dereq_('./Metrics');
var Grid = require('../collision/Grid'); var Grid = _dereq_('../collision/Grid');
var Events = require('./Events'); var Events = _dereq_('./Events');
var Composite = require('../body/Composite'); var Composite = _dereq_('../body/Composite');
var Constraint = require('../constraint/Constraint'); var Constraint = _dereq_('../constraint/Constraint');
var Common = require('./Common'); var Common = _dereq_('./Common');
var Body = require('../body/Body'); var Body = _dereq_('../body/Body');
(function() { (function() {
@ -5123,7 +5123,7 @@ var Body = require('../body/Body');
})(); })();
},{"../body/Body":1,"../body/Composite":2,"../body/World":3,"../collision/Grid":6,"../collision/Pairs":8,"../collision/Resolver":10,"../constraint/Constraint":12,"../render/Render":31,"./Common":14,"./Events":16,"./Metrics":18,"./Sleeping":22}],16:[function(require,module,exports){ },{"../body/Body":1,"../body/Composite":2,"../body/World":3,"../collision/Grid":6,"../collision/Pairs":8,"../collision/Resolver":10,"../constraint/Constraint":12,"../render/Render":31,"./Common":14,"./Events":16,"./Metrics":18,"./Sleeping":22}],16:[function(_dereq_,module,exports){
/** /**
* The `Matter.Events` module contains methods to fire and listen to events on other objects. * The `Matter.Events` module contains methods to fire and listen to events on other objects.
* *
@ -5136,7 +5136,7 @@ var Events = {};
module.exports = Events; module.exports = Events;
var Common = require('./Common'); var Common = _dereq_('./Common');
(function() { (function() {
@ -5235,7 +5235,7 @@ var Common = require('./Common');
})(); })();
},{"./Common":14}],17:[function(require,module,exports){ },{"./Common":14}],17:[function(_dereq_,module,exports){
/** /**
* The `Matter` module is the top level namespace. It also includes a function for installing plugins on top of the library. * The `Matter` module is the top level namespace. It also includes a function for installing plugins on top of the library.
* *
@ -5246,8 +5246,8 @@ var Matter = {};
module.exports = Matter; module.exports = Matter;
var Plugin = require('./Plugin'); var Plugin = _dereq_('./Plugin');
var Common = require('./Common'); var Common = _dereq_('./Common');
(function() { (function() {
@ -5265,7 +5265,7 @@ var Common = require('./Common');
* @readOnly * @readOnly
* @type {String} * @type {String}
*/ */
Matter.version = '0.11.0'; Matter.version = '0.11.1';
/** /**
* A list of plugin dependencies to be installed. These are normally set and installed through `Matter.use`. * A list of plugin dependencies to be installed. These are normally set and installed through `Matter.use`.
@ -5323,9 +5323,9 @@ var Common = require('./Common');
})(); })();
},{"./Common":14,"./Plugin":20}],18:[function(require,module,exports){ },{"./Common":14,"./Plugin":20}],18:[function(_dereq_,module,exports){
},{"../body/Composite":2,"./Common":14}],19:[function(require,module,exports){ },{"../body/Composite":2,"./Common":14}],19:[function(_dereq_,module,exports){
/** /**
* The `Matter.Mouse` module contains methods for creating and manipulating mouse inputs. * The `Matter.Mouse` module contains methods for creating and manipulating mouse inputs.
* *
@ -5336,7 +5336,7 @@ var Mouse = {};
module.exports = Mouse; module.exports = Mouse;
var Common = require('../core/Common'); var Common = _dereq_('../core/Common');
(function() { (function() {
@ -5528,7 +5528,7 @@ var Common = require('../core/Common');
})(); })();
},{"../core/Common":14}],20:[function(require,module,exports){ },{"../core/Common":14}],20:[function(_dereq_,module,exports){
/** /**
* The `Matter.Plugin` module contains functions for registering and installing plugins on modules. * The `Matter.Plugin` module contains functions for registering and installing plugins on modules.
* *
@ -5539,7 +5539,7 @@ var Plugin = {};
module.exports = Plugin; module.exports = Plugin;
var Common = require('./Common'); var Common = _dereq_('./Common');
(function() { (function() {
@ -5874,7 +5874,7 @@ var Common = require('./Common');
})(); })();
},{"./Common":14}],21:[function(require,module,exports){ },{"./Common":14}],21:[function(_dereq_,module,exports){
/** /**
* The `Matter.Runner` module is an optional utility which provides a game loop, * The `Matter.Runner` module is an optional utility which provides a game loop,
* that handles continuously updating a `Matter.Engine` for you within a browser. * that handles continuously updating a `Matter.Engine` for you within a browser.
@ -5891,9 +5891,9 @@ var Runner = {};
module.exports = Runner; module.exports = Runner;
var Events = require('./Events'); var Events = _dereq_('./Events');
var Engine = require('./Engine'); var Engine = _dereq_('./Engine');
var Common = require('./Common'); var Common = _dereq_('./Common');
(function() { (function() {
@ -6206,7 +6206,7 @@ var Common = require('./Common');
})(); })();
},{"./Common":14,"./Engine":15,"./Events":16}],22:[function(require,module,exports){ },{"./Common":14,"./Engine":15,"./Events":16}],22:[function(_dereq_,module,exports){
/** /**
* The `Matter.Sleeping` module contains methods to manage the sleeping state of bodies. * The `Matter.Sleeping` module contains methods to manage the sleeping state of bodies.
* *
@ -6217,7 +6217,7 @@ var Sleeping = {};
module.exports = Sleeping; module.exports = Sleeping;
var Events = require('./Events'); var Events = _dereq_('./Events');
(function() { (function() {
@ -6337,7 +6337,7 @@ var Events = require('./Events');
})(); })();
},{"./Events":16}],23:[function(require,module,exports){ },{"./Events":16}],23:[function(_dereq_,module,exports){
/** /**
* The `Matter.Bodies` module contains factory methods for creating rigid body models * The `Matter.Bodies` module contains factory methods for creating rigid body models
* with commonly used body configurations (such as rectangles, circles and other polygons). * with commonly used body configurations (such as rectangles, circles and other polygons).
@ -6353,11 +6353,11 @@ var Bodies = {};
module.exports = Bodies; module.exports = Bodies;
var Vertices = require('../geometry/Vertices'); var Vertices = _dereq_('../geometry/Vertices');
var Common = require('../core/Common'); var Common = _dereq_('../core/Common');
var Body = require('../body/Body'); var Body = _dereq_('../body/Body');
var Bounds = require('../geometry/Bounds'); var Bounds = _dereq_('../geometry/Bounds');
var Vector = require('../geometry/Vector'); var Vector = _dereq_('../geometry/Vector');
(function() { (function() {
@ -6667,7 +6667,7 @@ var Vector = require('../geometry/Vector');
}; };
})(); })();
},{"../body/Body":1,"../core/Common":14,"../geometry/Bounds":26,"../geometry/Vector":28,"../geometry/Vertices":29}],24:[function(require,module,exports){ },{"../body/Body":1,"../core/Common":14,"../geometry/Bounds":26,"../geometry/Vector":28,"../geometry/Vertices":29}],24:[function(_dereq_,module,exports){
/** /**
* The `Matter.Composites` module contains factory methods for creating composite bodies * The `Matter.Composites` module contains factory methods for creating composite bodies
* with commonly used configurations (such as stacks and chains). * with commonly used configurations (such as stacks and chains).
@ -6681,11 +6681,11 @@ var Composites = {};
module.exports = Composites; module.exports = Composites;
var Composite = require('../body/Composite'); var Composite = _dereq_('../body/Composite');
var Constraint = require('../constraint/Constraint'); var Constraint = _dereq_('../constraint/Constraint');
var Common = require('../core/Common'); var Common = _dereq_('../core/Common');
var Body = require('../body/Body'); var Body = _dereq_('../body/Body');
var Bodies = require('./Bodies'); var Bodies = _dereq_('./Bodies');
(function() { (function() {
@ -6996,7 +6996,7 @@ var Bodies = require('./Bodies');
})(); })();
},{"../body/Body":1,"../body/Composite":2,"../constraint/Constraint":12,"../core/Common":14,"./Bodies":23}],25:[function(require,module,exports){ },{"../body/Body":1,"../body/Composite":2,"../constraint/Constraint":12,"../core/Common":14,"./Bodies":23}],25:[function(_dereq_,module,exports){
/** /**
* The `Matter.Axes` module contains methods for creating and manipulating sets of axes. * The `Matter.Axes` module contains methods for creating and manipulating sets of axes.
* *
@ -7007,8 +7007,8 @@ var Axes = {};
module.exports = Axes; module.exports = Axes;
var Vector = require('../geometry/Vector'); var Vector = _dereq_('../geometry/Vector');
var Common = require('../core/Common'); var Common = _dereq_('../core/Common');
(function() { (function() {
@ -7062,7 +7062,7 @@ var Common = require('../core/Common');
})(); })();
},{"../core/Common":14,"../geometry/Vector":28}],26:[function(require,module,exports){ },{"../core/Common":14,"../geometry/Vector":28}],26:[function(_dereq_,module,exports){
/** /**
* The `Matter.Bounds` module contains methods for creating and manipulating axis-aligned bounding boxes (AABB). * The `Matter.Bounds` module contains methods for creating and manipulating axis-aligned bounding boxes (AABB).
* *
@ -7184,7 +7184,7 @@ module.exports = Bounds;
})(); })();
},{}],27:[function(require,module,exports){ },{}],27:[function(_dereq_,module,exports){
/** /**
* The `Matter.Svg` module contains methods for converting SVG images into an array of vector points. * The `Matter.Svg` module contains methods for converting SVG images into an array of vector points.
* *
@ -7199,7 +7199,7 @@ var Svg = {};
module.exports = Svg; module.exports = Svg;
var Bounds = require('../geometry/Bounds'); var Bounds = _dereq_('../geometry/Bounds');
(function() { (function() {
@ -7402,7 +7402,7 @@ var Bounds = require('../geometry/Bounds');
}; };
})(); })();
},{"../geometry/Bounds":26}],28:[function(require,module,exports){ },{"../geometry/Bounds":26}],28:[function(_dereq_,module,exports){
/** /**
* The `Matter.Vector` module contains methods for creating and manipulating vectors. * The `Matter.Vector` module contains methods for creating and manipulating vectors.
* Vectors are the basis of all the geometry related operations in the engine. * Vectors are the basis of all the geometry related operations in the engine.
@ -7638,7 +7638,7 @@ module.exports = Vector;
Vector.create(), Vector.create()]; Vector.create(), Vector.create()];
})(); })();
},{}],29:[function(require,module,exports){ },{}],29:[function(_dereq_,module,exports){
/** /**
* The `Matter.Vertices` module contains methods for creating and manipulating sets of vertices. * The `Matter.Vertices` module contains methods for creating and manipulating sets of vertices.
* A set of vertices is an array of `Matter.Vector` with additional indexing properties inserted by `Vertices.create`. * A set of vertices is an array of `Matter.Vector` with additional indexing properties inserted by `Vertices.create`.
@ -7653,8 +7653,8 @@ var Vertices = {};
module.exports = Vertices; module.exports = Vertices;
var Vector = require('../geometry/Vector'); var Vector = _dereq_('../geometry/Vector');
var Common = require('../core/Common'); var Common = _dereq_('../core/Common');
(function() { (function() {
@ -8085,45 +8085,45 @@ var Common = require('../core/Common');
})(); })();
},{"../core/Common":14,"../geometry/Vector":28}],30:[function(require,module,exports){ },{"../core/Common":14,"../geometry/Vector":28}],30:[function(_dereq_,module,exports){
var Matter = module.exports = require('../core/Matter'); var Matter = module.exports = _dereq_('../core/Matter');
Matter.Body = require('../body/Body'); Matter.Body = _dereq_('../body/Body');
Matter.Composite = require('../body/Composite'); Matter.Composite = _dereq_('../body/Composite');
Matter.World = require('../body/World'); Matter.World = _dereq_('../body/World');
Matter.Contact = require('../collision/Contact'); Matter.Contact = _dereq_('../collision/Contact');
Matter.Detector = require('../collision/Detector'); Matter.Detector = _dereq_('../collision/Detector');
Matter.Grid = require('../collision/Grid'); Matter.Grid = _dereq_('../collision/Grid');
Matter.Pairs = require('../collision/Pairs'); Matter.Pairs = _dereq_('../collision/Pairs');
Matter.Pair = require('../collision/Pair'); Matter.Pair = _dereq_('../collision/Pair');
Matter.Query = require('../collision/Query'); Matter.Query = _dereq_('../collision/Query');
Matter.Resolver = require('../collision/Resolver'); Matter.Resolver = _dereq_('../collision/Resolver');
Matter.SAT = require('../collision/SAT'); Matter.SAT = _dereq_('../collision/SAT');
Matter.Constraint = require('../constraint/Constraint'); Matter.Constraint = _dereq_('../constraint/Constraint');
Matter.MouseConstraint = require('../constraint/MouseConstraint'); Matter.MouseConstraint = _dereq_('../constraint/MouseConstraint');
Matter.Common = require('../core/Common'); Matter.Common = _dereq_('../core/Common');
Matter.Engine = require('../core/Engine'); Matter.Engine = _dereq_('../core/Engine');
Matter.Events = require('../core/Events'); Matter.Events = _dereq_('../core/Events');
Matter.Mouse = require('../core/Mouse'); Matter.Mouse = _dereq_('../core/Mouse');
Matter.Runner = require('../core/Runner'); Matter.Runner = _dereq_('../core/Runner');
Matter.Sleeping = require('../core/Sleeping'); Matter.Sleeping = _dereq_('../core/Sleeping');
Matter.Plugin = require('../core/Plugin'); Matter.Plugin = _dereq_('../core/Plugin');
Matter.Bodies = require('../factory/Bodies'); Matter.Bodies = _dereq_('../factory/Bodies');
Matter.Composites = require('../factory/Composites'); Matter.Composites = _dereq_('../factory/Composites');
Matter.Axes = require('../geometry/Axes'); Matter.Axes = _dereq_('../geometry/Axes');
Matter.Bounds = require('../geometry/Bounds'); Matter.Bounds = _dereq_('../geometry/Bounds');
Matter.Svg = require('../geometry/Svg'); Matter.Svg = _dereq_('../geometry/Svg');
Matter.Vector = require('../geometry/Vector'); Matter.Vector = _dereq_('../geometry/Vector');
Matter.Vertices = require('../geometry/Vertices'); Matter.Vertices = _dereq_('../geometry/Vertices');
Matter.Render = require('../render/Render'); Matter.Render = _dereq_('../render/Render');
Matter.RenderPixi = require('../render/RenderPixi'); Matter.RenderPixi = _dereq_('../render/RenderPixi');
// aliases // aliases
@ -8135,7 +8135,7 @@ Matter.World.addConstraint = Matter.Composite.addConstraint;
Matter.World.clear = Matter.Composite.clear; Matter.World.clear = Matter.Composite.clear;
Matter.Engine.run = Matter.Runner.run; Matter.Engine.run = Matter.Runner.run;
},{"../body/Body":1,"../body/Composite":2,"../body/World":3,"../collision/Contact":4,"../collision/Detector":5,"../collision/Grid":6,"../collision/Pair":7,"../collision/Pairs":8,"../collision/Query":9,"../collision/Resolver":10,"../collision/SAT":11,"../constraint/Constraint":12,"../constraint/MouseConstraint":13,"../core/Common":14,"../core/Engine":15,"../core/Events":16,"../core/Matter":17,"../core/Metrics":18,"../core/Mouse":19,"../core/Plugin":20,"../core/Runner":21,"../core/Sleeping":22,"../factory/Bodies":23,"../factory/Composites":24,"../geometry/Axes":25,"../geometry/Bounds":26,"../geometry/Svg":27,"../geometry/Vector":28,"../geometry/Vertices":29,"../render/Render":31,"../render/RenderPixi":32}],31:[function(require,module,exports){ },{"../body/Body":1,"../body/Composite":2,"../body/World":3,"../collision/Contact":4,"../collision/Detector":5,"../collision/Grid":6,"../collision/Pair":7,"../collision/Pairs":8,"../collision/Query":9,"../collision/Resolver":10,"../collision/SAT":11,"../constraint/Constraint":12,"../constraint/MouseConstraint":13,"../core/Common":14,"../core/Engine":15,"../core/Events":16,"../core/Matter":17,"../core/Metrics":18,"../core/Mouse":19,"../core/Plugin":20,"../core/Runner":21,"../core/Sleeping":22,"../factory/Bodies":23,"../factory/Composites":24,"../geometry/Axes":25,"../geometry/Bounds":26,"../geometry/Svg":27,"../geometry/Vector":28,"../geometry/Vertices":29,"../render/Render":31,"../render/RenderPixi":32}],31:[function(_dereq_,module,exports){
/** /**
* The `Matter.Render` module is a simple HTML5 canvas based renderer for visualising instances of `Matter.Engine`. * The `Matter.Render` module is a simple HTML5 canvas based renderer for visualising instances of `Matter.Engine`.
* It is intended for development and debugging purposes, but may also be suitable for simple games. * It is intended for development and debugging purposes, but may also be suitable for simple games.
@ -8148,12 +8148,12 @@ var Render = {};
module.exports = Render; module.exports = Render;
var Common = require('../core/Common'); var Common = _dereq_('../core/Common');
var Composite = require('../body/Composite'); var Composite = _dereq_('../body/Composite');
var Bounds = require('../geometry/Bounds'); var Bounds = _dereq_('../geometry/Bounds');
var Events = require('../core/Events'); var Events = _dereq_('../core/Events');
var Grid = require('../collision/Grid'); var Grid = _dereq_('../collision/Grid');
var Vector = require('../geometry/Vector'); var Vector = _dereq_('../geometry/Vector');
(function() { (function() {
@ -9452,7 +9452,7 @@ var Vector = require('../geometry/Vector');
})(); })();
},{"../body/Composite":2,"../collision/Grid":6,"../core/Common":14,"../core/Events":16,"../geometry/Bounds":26,"../geometry/Vector":28}],32:[function(require,module,exports){ },{"../body/Composite":2,"../collision/Grid":6,"../core/Common":14,"../core/Events":16,"../geometry/Bounds":26,"../geometry/Vector":28}],32:[function(_dereq_,module,exports){
/** /**
* The `Matter.RenderPixi` module is an example renderer using pixi.js. * The `Matter.RenderPixi` module is an example renderer using pixi.js.
* See also `Matter.Render` for a canvas based renderer. * See also `Matter.Render` for a canvas based renderer.
@ -9466,11 +9466,11 @@ var RenderPixi = {};
module.exports = RenderPixi; module.exports = RenderPixi;
var Bounds = require('../geometry/Bounds'); var Bounds = _dereq_('../geometry/Bounds');
var Composite = require('../body/Composite'); var Composite = _dereq_('../body/Composite');
var Common = require('../core/Common'); var Common = _dereq_('../core/Common');
var Events = require('../core/Events'); var Events = _dereq_('../core/Events');
var Vector = require('../geometry/Vector'); var Vector = _dereq_('../geometry/Vector');
(function() { (function() {

4
build/matter.min.js vendored
View file

@ -1,5 +1,5 @@
/** /**
* matter-js 0.11.0 by @liabru 2016-11-04 * matter-js 0.11.1 by @liabru 2016-11-09
* http://brm.io/matter-js/ * http://brm.io/matter-js/
* License MIT * License MIT
*/ */
@ -40,7 +40,7 @@ var n=e[o];n._chained?t.push.apply(t,n._chained):t.push(n)}var i=function(){for(
if(e||n.render){var r={element:e,controller:a};n.render=f.extend(r,n.render)}return n.render&&n.render.controller&&(n.render=n.render.controller.create(n.render)),n.render&&(n.render.engine=n),n.world=t.world||i.create(n.world),n.pairs=l.create(),n.broadphase=n.broadphase.controller.create(n.broadphase),n.metrics=n.metrics||{extended:!1},n},n.update=function(n,i,a){i=i||1e3/60,a=a||1;var c,f=n.world,v=n.timing,m=n.broadphase,y=[];v.timestamp+=i*v.timeScale;var g={timestamp:v.timestamp};u.trigger(n,"beforeUpdate",g);var x=d.allBodies(f),h=d.allConstraints(f);for(n.enableSleeping&&r.update(x,v.timeScale),t(x,f.gravity),o(x,i,v.timeScale,a,f.bounds),c=0;c<n.constraintIterations;c++)p.solveAll(h,v.timeScale);p.postSolveAll(x),m.controller?(f.isModified&&m.controller.clear(m),m.controller.update(m,x,n,f.isModified),y=m.pairsList):y=x,f.isModified&&d.setModified(f,!1,!1,!0);var b=m.detector(y,n),w=n.pairs,S=v.timestamp;for(l.update(w,b,S),l.removeOld(w,S),n.enableSleeping&&r.afterCollisions(w.list,v.timeScale), if(e||n.render){var r={element:e,controller:a};n.render=f.extend(r,n.render)}return n.render&&n.render.controller&&(n.render=n.render.controller.create(n.render)),n.render&&(n.render.engine=n),n.world=t.world||i.create(n.world),n.pairs=l.create(),n.broadphase=n.broadphase.controller.create(n.broadphase),n.metrics=n.metrics||{extended:!1},n},n.update=function(n,i,a){i=i||1e3/60,a=a||1;var c,f=n.world,v=n.timing,m=n.broadphase,y=[];v.timestamp+=i*v.timeScale;var g={timestamp:v.timestamp};u.trigger(n,"beforeUpdate",g);var x=d.allBodies(f),h=d.allConstraints(f);for(n.enableSleeping&&r.update(x,v.timeScale),t(x,f.gravity),o(x,i,v.timeScale,a,f.bounds),c=0;c<n.constraintIterations;c++)p.solveAll(h,v.timeScale);p.postSolveAll(x),m.controller?(f.isModified&&m.controller.clear(m),m.controller.update(m,x,n,f.isModified),y=m.pairsList):y=x,f.isModified&&d.setModified(f,!1,!1,!0);var b=m.detector(y,n),w=n.pairs,S=v.timestamp;for(l.update(w,b,S),l.removeOld(w,S),n.enableSleeping&&r.afterCollisions(w.list,v.timeScale),
w.collisionStart.length>0&&u.trigger(n,"collisionStart",{pairs:w.collisionStart}),s.preSolvePosition(w.list),c=0;c<n.positionIterations;c++)s.solvePosition(w.list,v.timeScale);for(s.postSolvePosition(x),s.preSolveVelocity(w.list),c=0;c<n.velocityIterations;c++)s.solveVelocity(w.list,v.timeScale);return w.collisionActive.length>0&&u.trigger(n,"collisionActive",{pairs:w.collisionActive}),w.collisionEnd.length>0&&u.trigger(n,"collisionEnd",{pairs:w.collisionEnd}),e(x),u.trigger(n,"afterUpdate",g),n},n.merge=function(e,t){if(f.extend(e,t),t.world){e.world=t.world,n.clear(e);for(var o=d.allBodies(e.world),i=0;i<o.length;i++){var s=o[i];r.set(s,!1),s.id=f.nextId()}}},n.clear=function(e){var t=e.world;l.clear(e.pairs);var o=e.broadphase;if(o.controller){var n=d.allBodies(t);o.controller.clear(o),o.controller.update(o,n,e,!0)}};var e=function(e){for(var t=0;t<e.length;t++){var o=e[t];o.force.x=0,o.force.y=0,o.torque=0}},t=function(e,t){var o="undefined"!=typeof t.scale?t.scale:.001;if((0!==t.x||0!==t.y)&&0!==o)for(var n=0;n<e.length;n++){ w.collisionStart.length>0&&u.trigger(n,"collisionStart",{pairs:w.collisionStart}),s.preSolvePosition(w.list),c=0;c<n.positionIterations;c++)s.solvePosition(w.list,v.timeScale);for(s.postSolvePosition(x),s.preSolveVelocity(w.list),c=0;c<n.velocityIterations;c++)s.solveVelocity(w.list,v.timeScale);return w.collisionActive.length>0&&u.trigger(n,"collisionActive",{pairs:w.collisionActive}),w.collisionEnd.length>0&&u.trigger(n,"collisionEnd",{pairs:w.collisionEnd}),e(x),u.trigger(n,"afterUpdate",g),n},n.merge=function(e,t){if(f.extend(e,t),t.world){e.world=t.world,n.clear(e);for(var o=d.allBodies(e.world),i=0;i<o.length;i++){var s=o[i];r.set(s,!1),s.id=f.nextId()}}},n.clear=function(e){var t=e.world;l.clear(e.pairs);var o=e.broadphase;if(o.controller){var n=d.allBodies(t);o.controller.clear(o),o.controller.update(o,n,e,!0)}};var e=function(e){for(var t=0;t<e.length;t++){var o=e[t];o.force.x=0,o.force.y=0,o.torque=0}},t=function(e,t){var o="undefined"!=typeof t.scale?t.scale:.001;if((0!==t.x||0!==t.y)&&0!==o)for(var n=0;n<e.length;n++){
var i=e[n];i.isStatic||i.isSleeping||(i.force.y+=i.mass*t.y*o,i.force.x+=i.mass*t.x*o)}},o=function(e,t,o,n,i){for(var r=0;r<e.length;r++){var s=e[r];s.isStatic||s.isSleeping||v.update(s,t,o,n)}}}()},{"../body/Body":1,"../body/Composite":2,"../body/World":3,"../collision/Grid":6,"../collision/Pairs":8,"../collision/Resolver":10,"../constraint/Constraint":12,"../render/Render":31,"./Common":14,"./Events":16,"./Metrics":18,"./Sleeping":22}],16:[function(e,t,o){var n={};t.exports=n;var i=e("./Common");!function(){n.on=function(e,t,o){for(var n,i=t.split(" "),r=0;r<i.length;r++)n=i[r],e.events=e.events||{},e.events[n]=e.events[n]||[],e.events[n].push(o);return o},n.off=function(e,t,o){if(!t)return void(e.events={});"function"==typeof t&&(o=t,t=i.keys(e.events).join(" "));for(var n=t.split(" "),r=0;r<n.length;r++){var s=e.events[n[r]],a=[];if(o&&s)for(var l=0;l<s.length;l++)s[l]!==o&&a.push(s[l]);e.events[n[r]]=a}},n.trigger=function(e,t,o){var n,r,s,a;if(e.events){o||(o={}),n=t.split(" ");for(var l=0;l<n.length;l++)if(r=n[l], var i=e[n];i.isStatic||i.isSleeping||(i.force.y+=i.mass*t.y*o,i.force.x+=i.mass*t.x*o)}},o=function(e,t,o,n,i){for(var r=0;r<e.length;r++){var s=e[r];s.isStatic||s.isSleeping||v.update(s,t,o,n)}}}()},{"../body/Body":1,"../body/Composite":2,"../body/World":3,"../collision/Grid":6,"../collision/Pairs":8,"../collision/Resolver":10,"../constraint/Constraint":12,"../render/Render":31,"./Common":14,"./Events":16,"./Metrics":18,"./Sleeping":22}],16:[function(e,t,o){var n={};t.exports=n;var i=e("./Common");!function(){n.on=function(e,t,o){for(var n,i=t.split(" "),r=0;r<i.length;r++)n=i[r],e.events=e.events||{},e.events[n]=e.events[n]||[],e.events[n].push(o);return o},n.off=function(e,t,o){if(!t)return void(e.events={});"function"==typeof t&&(o=t,t=i.keys(e.events).join(" "));for(var n=t.split(" "),r=0;r<n.length;r++){var s=e.events[n[r]],a=[];if(o&&s)for(var l=0;l<s.length;l++)s[l]!==o&&a.push(s[l]);e.events[n[r]]=a}},n.trigger=function(e,t,o){var n,r,s,a;if(e.events){o||(o={}),n=t.split(" ");for(var l=0;l<n.length;l++)if(r=n[l],
s=e.events[r]){a=i.clone(o,!1),a.name=r,a.source=e;for(var c=0;c<s.length;c++)s[c].apply(e,[a])}}}}()},{"./Common":14}],17:[function(e,t,o){var n={};t.exports=n;var i=e("./Plugin"),r=e("./Common");!function(){n.name="matter-js",n.version="0.11.0",n.uses=[],n.used=[],n.use=function(){i.use(n,Array.prototype.slice.call(arguments))},n.before=function(e,t){return e=e.replace(/^Matter./,""),r.chainPathBefore(n,e,t)},n.after=function(e,t){return e=e.replace(/^Matter./,""),r.chainPathAfter(n,e,t)}}()},{"./Common":14,"./Plugin":20}],18:[function(e,t,o){},{"../body/Composite":2,"./Common":14}],19:[function(e,t,o){var n={};t.exports=n;var i=e("../core/Common");!function(){n.create=function(t){var o={};return t||i.log("Mouse.create: element was undefined, defaulting to document.body","warn"),o.element=t||document.body,o.absolute={x:0,y:0},o.position={x:0,y:0},o.mousedownPosition={x:0,y:0},o.mouseupPosition={x:0,y:0},o.offset={x:0,y:0},o.scale={x:1,y:1},o.wheelDelta=0,o.button=-1,o.pixelRatio=o.element.getAttribute("data-pixel-ratio")||1, s=e.events[r]){a=i.clone(o,!1),a.name=r,a.source=e;for(var c=0;c<s.length;c++)s[c].apply(e,[a])}}}}()},{"./Common":14}],17:[function(e,t,o){var n={};t.exports=n;var i=e("./Plugin"),r=e("./Common");!function(){n.name="matter-js",n.version="0.11.1",n.uses=[],n.used=[],n.use=function(){i.use(n,Array.prototype.slice.call(arguments))},n.before=function(e,t){return e=e.replace(/^Matter./,""),r.chainPathBefore(n,e,t)},n.after=function(e,t){return e=e.replace(/^Matter./,""),r.chainPathAfter(n,e,t)}}()},{"./Common":14,"./Plugin":20}],18:[function(e,t,o){},{"../body/Composite":2,"./Common":14}],19:[function(e,t,o){var n={};t.exports=n;var i=e("../core/Common");!function(){n.create=function(t){var o={};return t||i.log("Mouse.create: element was undefined, defaulting to document.body","warn"),o.element=t||document.body,o.absolute={x:0,y:0},o.position={x:0,y:0},o.mousedownPosition={x:0,y:0},o.mouseupPosition={x:0,y:0},o.offset={x:0,y:0},o.scale={x:1,y:1},o.wheelDelta=0,o.button=-1,o.pixelRatio=o.element.getAttribute("data-pixel-ratio")||1,
o.sourceEvents={mousemove:null,mousedown:null,mouseup:null,mousewheel:null},o.mousemove=function(t){var n=e(t,o.element,o.pixelRatio),i=t.changedTouches;i&&(o.button=0,t.preventDefault()),o.absolute.x=n.x,o.absolute.y=n.y,o.position.x=o.absolute.x*o.scale.x+o.offset.x,o.position.y=o.absolute.y*o.scale.y+o.offset.y,o.sourceEvents.mousemove=t},o.mousedown=function(t){var n=e(t,o.element,o.pixelRatio),i=t.changedTouches;i?(o.button=0,t.preventDefault()):o.button=t.button,o.absolute.x=n.x,o.absolute.y=n.y,o.position.x=o.absolute.x*o.scale.x+o.offset.x,o.position.y=o.absolute.y*o.scale.y+o.offset.y,o.mousedownPosition.x=o.position.x,o.mousedownPosition.y=o.position.y,o.sourceEvents.mousedown=t},o.mouseup=function(t){var n=e(t,o.element,o.pixelRatio),i=t.changedTouches;i&&t.preventDefault(),o.button=-1,o.absolute.x=n.x,o.absolute.y=n.y,o.position.x=o.absolute.x*o.scale.x+o.offset.x,o.position.y=o.absolute.y*o.scale.y+o.offset.y,o.mouseupPosition.x=o.position.x,o.mouseupPosition.y=o.position.y, o.sourceEvents={mousemove:null,mousedown:null,mouseup:null,mousewheel:null},o.mousemove=function(t){var n=e(t,o.element,o.pixelRatio),i=t.changedTouches;i&&(o.button=0,t.preventDefault()),o.absolute.x=n.x,o.absolute.y=n.y,o.position.x=o.absolute.x*o.scale.x+o.offset.x,o.position.y=o.absolute.y*o.scale.y+o.offset.y,o.sourceEvents.mousemove=t},o.mousedown=function(t){var n=e(t,o.element,o.pixelRatio),i=t.changedTouches;i?(o.button=0,t.preventDefault()):o.button=t.button,o.absolute.x=n.x,o.absolute.y=n.y,o.position.x=o.absolute.x*o.scale.x+o.offset.x,o.position.y=o.absolute.y*o.scale.y+o.offset.y,o.mousedownPosition.x=o.position.x,o.mousedownPosition.y=o.position.y,o.sourceEvents.mousedown=t},o.mouseup=function(t){var n=e(t,o.element,o.pixelRatio),i=t.changedTouches;i&&t.preventDefault(),o.button=-1,o.absolute.x=n.x,o.absolute.y=n.y,o.position.x=o.absolute.x*o.scale.x+o.offset.x,o.position.y=o.absolute.y*o.scale.y+o.offset.y,o.mouseupPosition.x=o.position.x,o.mouseupPosition.y=o.position.y,
o.sourceEvents.mouseup=t},o.mousewheel=function(e){o.wheelDelta=Math.max(-1,Math.min(1,e.wheelDelta||-e.detail)),e.preventDefault()},n.setElement(o,o.element),o},n.setElement=function(e,t){e.element=t,t.addEventListener("mousemove",e.mousemove),t.addEventListener("mousedown",e.mousedown),t.addEventListener("mouseup",e.mouseup),t.addEventListener("mousewheel",e.mousewheel),t.addEventListener("DOMMouseScroll",e.mousewheel),t.addEventListener("touchmove",e.mousemove),t.addEventListener("touchstart",e.mousedown),t.addEventListener("touchend",e.mouseup)},n.clearSourceEvents=function(e){e.sourceEvents.mousemove=null,e.sourceEvents.mousedown=null,e.sourceEvents.mouseup=null,e.sourceEvents.mousewheel=null,e.wheelDelta=0},n.setOffset=function(e,t){e.offset.x=t.x,e.offset.y=t.y,e.position.x=e.absolute.x*e.scale.x+e.offset.x,e.position.y=e.absolute.y*e.scale.y+e.offset.y},n.setScale=function(e,t){e.scale.x=t.x,e.scale.y=t.y,e.position.x=e.absolute.x*e.scale.x+e.offset.x,e.position.y=e.absolute.y*e.scale.y+e.offset.y; o.sourceEvents.mouseup=t},o.mousewheel=function(e){o.wheelDelta=Math.max(-1,Math.min(1,e.wheelDelta||-e.detail)),e.preventDefault()},n.setElement(o,o.element),o},n.setElement=function(e,t){e.element=t,t.addEventListener("mousemove",e.mousemove),t.addEventListener("mousedown",e.mousedown),t.addEventListener("mouseup",e.mouseup),t.addEventListener("mousewheel",e.mousewheel),t.addEventListener("DOMMouseScroll",e.mousewheel),t.addEventListener("touchmove",e.mousemove),t.addEventListener("touchstart",e.mousedown),t.addEventListener("touchend",e.mouseup)},n.clearSourceEvents=function(e){e.sourceEvents.mousemove=null,e.sourceEvents.mousedown=null,e.sourceEvents.mouseup=null,e.sourceEvents.mousewheel=null,e.wheelDelta=0},n.setOffset=function(e,t){e.offset.x=t.x,e.offset.y=t.y,e.position.x=e.absolute.x*e.scale.x+e.offset.x,e.position.y=e.absolute.y*e.scale.y+e.offset.y},n.setScale=function(e,t){e.scale.x=t.x,e.scale.y=t.y,e.position.x=e.absolute.x*e.scale.x+e.offset.x,e.position.y=e.absolute.y*e.scale.y+e.offset.y;
};var e=function(e,t,o){var n,i,r=t.getBoundingClientRect(),s=document.documentElement||document.body.parentNode||document.body,a=void 0!==window.pageXOffset?window.pageXOffset:s.scrollLeft,l=void 0!==window.pageYOffset?window.pageYOffset:s.scrollTop,c=e.changedTouches;return c?(n=c[0].pageX-r.left-a,i=c[0].pageY-r.top-l):(n=e.pageX-r.left-a,i=e.pageY-r.top-l),{x:n/(t.clientWidth/(t.width||t.clientWidth)*o),y:i/(t.clientHeight/(t.height||t.clientHeight)*o)}}}()},{"../core/Common":14}],20:[function(e,t,o){var n={};t.exports=n;var i=e("./Common");!function(){n._registry={},n.register=function(e){if(n.isPlugin(e)||i.warn("Plugin.register:",n.toString(e),"does not implement all required fields."),e.name in n._registry){var t=n._registry[e.name],o=n.versionParse(e.version).number,r=n.versionParse(t.version).number;o>r?(i.warn("Plugin.register:",n.toString(t),"was upgraded to",n.toString(e)),n._registry[e.name]=e):r>o?i.warn("Plugin.register:",n.toString(t),"can not be downgraded to",n.toString(e)):e!==t&&i.warn("Plugin.register:",n.toString(e),"is already registered to different plugin object"); };var e=function(e,t,o){var n,i,r=t.getBoundingClientRect(),s=document.documentElement||document.body.parentNode||document.body,a=void 0!==window.pageXOffset?window.pageXOffset:s.scrollLeft,l=void 0!==window.pageYOffset?window.pageYOffset:s.scrollTop,c=e.changedTouches;return c?(n=c[0].pageX-r.left-a,i=c[0].pageY-r.top-l):(n=e.pageX-r.left-a,i=e.pageY-r.top-l),{x:n/(t.clientWidth/(t.width||t.clientWidth)*o),y:i/(t.clientHeight/(t.height||t.clientHeight)*o)}}}()},{"../core/Common":14}],20:[function(e,t,o){var n={};t.exports=n;var i=e("./Common");!function(){n._registry={},n.register=function(e){if(n.isPlugin(e)||i.warn("Plugin.register:",n.toString(e),"does not implement all required fields."),e.name in n._registry){var t=n._registry[e.name],o=n.versionParse(e.version).number,r=n.versionParse(t.version).number;o>r?(i.warn("Plugin.register:",n.toString(t),"was upgraded to",n.toString(e)),n._registry[e.name]=e):r>o?i.warn("Plugin.register:",n.toString(t),"can not be downgraded to",n.toString(e)):e!==t&&i.warn("Plugin.register:",n.toString(e),"is already registered to different plugin object");

View file

@ -1,6 +1,6 @@
{ {
"name": "matter-js", "name": "matter-js",
"version": "0.11.0", "version": "0.11.1",
"license": "MIT", "license": "MIT",
"homepage": "http://brm.io/matter-js/", "homepage": "http://brm.io/matter-js/",
"author": "Liam Brummitt <liam@brm.io> (http://brm.io/)", "author": "Liam Brummitt <liam@brm.io> (http://brm.io/)",