0
0
Fork 0
mirror of https://github.com/liabru/matter-js.git synced 2024-11-23 09:26:51 -05:00

added options to Metrics.create

This commit is contained in:
liabru 2015-07-07 21:07:48 +01:00
parent 2ab20b0656
commit 1b7e27d8a4
2 changed files with 5 additions and 3 deletions

View file

@ -75,7 +75,7 @@ var Engine = {};
engine.metrics = engine.metrics || { extended: false };
// @if DEBUG
engine.metrics = engine.metrics || Metrics.create();
engine.metrics = Metrics.create(engine.metrics);
// @endif
return engine;

View file

@ -14,8 +14,8 @@ var Metrics = {};
* @private
* @return {metrics} A new metrics
*/
Metrics.create = function() {
return {
Metrics.create = function(options) {
var defaults = {
extended: false,
narrowDetections: 0,
narrowphaseTests: 0,
@ -31,6 +31,8 @@ var Metrics = {};
bodies: 0,
pairs: 0
};
return Common.extend(defaults, false, options);
};
/**