mirror of
https://github.com/liabru/matter-js.git
synced 2025-03-13 00:28:28 -04:00
Issue #855: Using seconds to calculate velocity from force
This commit is contained in:
parent
5a0079df1b
commit
8a4480eb0a
1 changed files with 2 additions and 1 deletions
|
@ -628,7 +628,8 @@ var Axes = require('../geometry/Axes');
|
|||
* @param {number} correction
|
||||
*/
|
||||
Body.update = function(body, deltaTime, timeScale, correction) {
|
||||
var deltaTimeSquared = Math.pow(deltaTime * timeScale * body.timeScale, 2);
|
||||
// Delta time squared in seconds
|
||||
var deltaTimeSquared = Math.pow(deltaTime / 1000 * timeScale * body.timeScale, 2);
|
||||
|
||||
// from the previous step
|
||||
var frictionAir = 1 - body.frictionAir * timeScale * body.timeScale,
|
||||
|
|
Loading…
Add table
Reference in a new issue