From 613e63699b25db0efddc3eb194f6d0fbba7492ef Mon Sep 17 00:00:00 2001 From: liabru Date: Wed, 23 Apr 2014 14:08:57 +0100 Subject: [PATCH] added per-body timeScale --- src/body/Body.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/body/Body.js b/src/body/Body.js index 4cc9d2d..6d9d623 100644 --- a/src/body/Body.js +++ b/src/body/Body.js @@ -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,