diff --git a/src/core/Engine.js b/src/core/Engine.js index eb22aa2..a6a3014 100644 --- a/src/core/Engine.js +++ b/src/core/Engine.js @@ -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; diff --git a/src/core/Metrics.js b/src/core/Metrics.js index 03d3eb9..13c1aaf 100644 --- a/src/core/Metrics.js +++ b/src/core/Metrics.js @@ -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); }; /**