mirror of
https://github.com/liabru/matter-js.git
synced 2024-11-27 09:50:52 -05:00
added per-body timeScale
This commit is contained in:
parent
6e6dc49b7a
commit
613e63699b
1 changed files with 2 additions and 1 deletions
|
@ -42,6 +42,7 @@ var Body = {};
|
|||
frictionAir: 0.01,
|
||||
groupId: 0,
|
||||
slop: 0.05,
|
||||
timeScale: 1,
|
||||
render: {
|
||||
visible: true,
|
||||
sprite: {
|
||||
|
@ -186,7 +187,7 @@ var Body = {};
|
|||
* @param {number} correction
|
||||
*/
|
||||
Body.update = function(body, deltaTime, correction) {
|
||||
var deltaTimeSquared = deltaTime * deltaTime;
|
||||
var deltaTimeSquared = deltaTime * deltaTime * body.timeScale;
|
||||
|
||||
// from the previous step
|
||||
var frictionAir = 1 - body.frictionAir,
|
||||
|
|
Loading…
Reference in a new issue