mirror of
https://github.com/liabru/matter-js.git
synced 2024-11-23 09:26:51 -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,
|
frictionAir: 0.01,
|
||||||
groupId: 0,
|
groupId: 0,
|
||||||
slop: 0.05,
|
slop: 0.05,
|
||||||
|
timeScale: 1,
|
||||||
render: {
|
render: {
|
||||||
visible: true,
|
visible: true,
|
||||||
sprite: {
|
sprite: {
|
||||||
|
@ -186,7 +187,7 @@ var Body = {};
|
||||||
* @param {number} correction
|
* @param {number} correction
|
||||||
*/
|
*/
|
||||||
Body.update = function(body, deltaTime, correction) {
|
Body.update = function(body, deltaTime, correction) {
|
||||||
var deltaTimeSquared = deltaTime * deltaTime;
|
var deltaTimeSquared = deltaTime * deltaTime * body.timeScale;
|
||||||
|
|
||||||
// from the previous step
|
// from the previous step
|
||||||
var frictionAir = 1 - body.frictionAir,
|
var frictionAir = 1 - body.frictionAir,
|
||||||
|
|
Loading…
Reference in a new issue