Skip to content

Commit 8017bdb

Browse files
committed
added docs for additional engine timing and render properties
1 parent e94b8b8 commit 8017bdb

2 files changed

Lines changed: 66 additions & 0 deletions

File tree

src/core/Engine.js

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -433,6 +433,25 @@ var Body = require('../body/Body');
433433
* @default 0
434434
*/
435435

436+
/**
437+
* A `Number` that represents the total execution time elapsed during the last `Engine.update` in milliseconds.
438+
* It is updated by timing from the start of the last `Engine.update` call until it ends.
439+
*
440+
* This value will also include the total execution time of all event handlers directly or indirectly triggered by the engine update.
441+
*
442+
* @property timing.lastElapsed
443+
* @type number
444+
* @default 0
445+
*/
446+
447+
/**
448+
* A `Number` that represents the `delta` value used in the last engine update.
449+
*
450+
* @property timing.lastDelta
451+
* @type number
452+
* @default 0
453+
*/
454+
436455
/**
437456
* A `Matter.Grid` instance.
438457
*

src/render/Render.js

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1683,6 +1683,53 @@ var Mouse = require('../core/Mouse');
16831683
* @default false
16841684
*/
16851685

1686+
/**
1687+
* A flag to enable or disable all debug information overlays together.
1688+
* This includes and has priority over the values of:
1689+
*
1690+
* - `render.options.showStats`
1691+
* - `render.options.showPerformance`
1692+
*
1693+
* @property options.showDebug
1694+
* @type boolean
1695+
* @default false
1696+
*/
1697+
1698+
/**
1699+
* A flag to enable or disable the engine stats info overlay.
1700+
* From left to right, the values shown are:
1701+
*
1702+
* - body parts total
1703+
* - body total
1704+
* - constraints total
1705+
* - composites total
1706+
* - collision pairs total
1707+
*
1708+
* @property options.showStats
1709+
* @type boolean
1710+
* @default false
1711+
*/
1712+
1713+
/**
1714+
* A flag to enable or disable performance charts.
1715+
* From left to right, the values shown are:
1716+
*
1717+
* - average render frequency (e.g. 60 fps)
1718+
* - exact engine delta time used for last update (e.g. 16.66ms)
1719+
* - average engine execution duration (e.g. 5.00ms)
1720+
* - average render execution duration (e.g. 0.40ms)
1721+
* - average effective play speed (e.g. '1.00x' is 'real-time')
1722+
*
1723+
* Each value is recorded over a fixed sample of past frames (60 frames).
1724+
*
1725+
* A chart shown below each value indicates the variance from the average over the sample.
1726+
* The more stable or fixed the value is the flatter the chart will appear.
1727+
*
1728+
* @property options.showPerformance
1729+
* @type boolean
1730+
* @default false
1731+
*/
1732+
16861733
/**
16871734
* A flag to enable or disable rendering entirely.
16881735
*

0 commit comments

Comments
 (0)