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 }; engine.metrics = engine.metrics || { extended: false };
// @if DEBUG // @if DEBUG
engine.metrics = engine.metrics || Metrics.create(); engine.metrics = Metrics.create(engine.metrics);
// @endif // @endif
return engine; return engine;

View file

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