mirror of
https://github.com/liabru/matter-js.git
synced 2024-11-23 09:26:51 -05:00
move substeps to another branch
This commit is contained in:
parent
66e291b57d
commit
db7c4a1342
1 changed files with 1 additions and 17 deletions
|
@ -52,7 +52,6 @@ var Common = require('./Common');
|
||||||
*/
|
*/
|
||||||
Runner.create = function(options) {
|
Runner.create = function(options) {
|
||||||
var defaults = {
|
var defaults = {
|
||||||
substeps: 1,
|
|
||||||
fps: 60,
|
fps: 60,
|
||||||
deltaSampleSize: 60,
|
deltaSampleSize: 60,
|
||||||
counterTimestamp: 0,
|
counterTimestamp: 0,
|
||||||
|
@ -151,12 +150,7 @@ var Common = require('./Common');
|
||||||
// update
|
// update
|
||||||
Events.trigger(runner, 'beforeUpdate', event);
|
Events.trigger(runner, 'beforeUpdate', event);
|
||||||
|
|
||||||
var substeps = runner.substeps,
|
Engine.update(engine, delta);
|
||||||
subDelta = delta / substeps;
|
|
||||||
|
|
||||||
for (var i = 0; i < substeps; i += 1) {
|
|
||||||
Engine.update(engine, subDelta);
|
|
||||||
}
|
|
||||||
|
|
||||||
Events.trigger(runner, 'afterUpdate', event);
|
Events.trigger(runner, 'afterUpdate', event);
|
||||||
|
|
||||||
|
@ -253,16 +247,6 @@ var Common = require('./Common');
|
||||||
* @default true
|
* @default true
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
|
||||||
* A `Number` integer that specifies the number of `Engine.update` calls made per-tick.
|
|
||||||
* Increasing the number of substeps improves accuracy at the cost of performance.
|
|
||||||
* By default `1` update is performed per tick with time `delta`.
|
|
||||||
* If `substeps > 1` then `substeps` updates are made with `delta` being `delta / substeps`.
|
|
||||||
* @property substeps
|
|
||||||
* @type number
|
|
||||||
* @default 1
|
|
||||||
*/
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A `Boolean` that specifies if the runner should use a fixed timestep (otherwise it is variable).
|
* 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 timing is fixed, then the apparent simulation speed will change depending on the frame rate (but behaviour will be deterministic).
|
||||||
|
|
Loading…
Reference in a new issue