mirror of
https://github.com/liabru/matter-js.git
synced 2024-12-25 13:39:06 -05:00
added options to Metrics.create
This commit is contained in:
parent
2ab20b0656
commit
1b7e27d8a4
2 changed files with 5 additions and 3 deletions
|
@ -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;
|
||||
|
|
|
@ -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);
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in a new issue