forked from phaserjs/phaser
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix Matter World update, runner creation
Fixes phaserjs#6977
- Loading branch information
Showing
3 changed files
with
25 additions
and
45 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,23 @@ | ||
/** | ||
* Configuration for the Matter Physics Runner. | ||
* | ||
* Set only one of `fps` and `delta`. | ||
* | ||
* `delta` is the size of the Runner's fixed time step (one physics update). | ||
* The "frame delta" is the time elapsed since the last game step. | ||
* Depending on the size of the frame delta, the Runner makes zero or more updates per game step. | ||
* | ||
* @typedef {object} Phaser.Types.Physics.Matter.MatterRunnerConfig | ||
* @since 3.22.0 | ||
* | ||
* @property {boolean} [isFixed=false] - A boolean that specifies if the runner should use a fixed timestep (otherwise it is variable). If timing is fixed, then the apparent simulation speed will change depending on the frame rate (but behaviour will be deterministic). If the timing is variable, then the apparent simulation speed will be constant (approximately, but at the cost of determininism). | ||
* @property {number} [fps=60] - A number that specifies the frame rate in seconds. If you don't specify this, but do specify `delta`, those values set the fps rate. | ||
* @property {number} [correction=1] - A number that specifies the time correction factor to apply to the update. This can help improve the accuracy of the simulation in cases where delta is changing between updates. | ||
* @property {number} [deltaSampleSize=60] - The size of the delta smoothing array when `isFixed` is `false`. | ||
* @property {number} [delta=16.666] - A number that specifies the time step between updates in milliseconds. If you set the `fps` property, this value is set based on that. If `isFixed` is set to `true`, then `delta` is fixed. If it is `false`, then `delta` can dynamically change to maintain the correct apparent simulation speed. | ||
* @property {number} [deltaMin=16.666] - A number that specifies the minimum time step between updates in milliseconds. | ||
* @property {number} [deltaMax=33.333] - A number that specifies the maximum time step between updates in milliseconds. | ||
* | ||
* @property {number} [fps] - The number of physics updates per second. If set, this overrides `delta`. | ||
* @property {number} [delta=16.666] - The size of the update time step in milliseconds. If `fps` is set, it overrides `delta`. | ||
* @property {boolean} [frameDeltaSmoothing=true] - Whether to smooth the frame delta values. | ||
* @property {boolean} [frameDeltaSnapping=true] - Whether to round the frame delta values to the nearest 1 Hz. | ||
* @property {number} [frameDeltaHistorySize=100] - The number of frame delta values to record, when smoothing is enabled. The 10th to 90th percentiles are sampled. | ||
* @property {number} [maxUpdates=null] - The maximum number of updates per frame. | ||
* @property {number} [maxFrameTime=33.333] - The maximum amount of time to simulate in one frame, in milliseconds. | ||
* @property {boolean} [enabled=true] - Whether the Matter Runner is enabled. | ||
* | ||
* @see Phaser.Physics.Matter.World#runner | ||
*/ |