diff --git a/examples/events.js b/examples/events.js index 4128740..4928e7d 100644 --- a/examples/events.js +++ b/examples/events.js @@ -47,7 +47,7 @@ Example.events = function() { // apply random forces every 5 secs if (Common.now() - lastTime >= 5000) { - shakeScene(engine, event.delta); + shakeScene(engine); // update last time lastTime = Common.now(); @@ -107,15 +107,14 @@ Example.events = function() { Composite.add(world, stack); - var shakeScene = function(engine, delta) { - var timeScale = delta / 1000; + var shakeScene = function(engine) { var bodies = Composite.allBodies(engine.world); for (var i = 0; i < bodies.length; i++) { var body = bodies[i]; if (!body.isStatic && body.position.y >= 500) { - // Scale force accounting for time delta. + // Scale force accounting for mass var forceMagnitude = (0.03 * body.mass); Body.applyForce(body, body.position, { @@ -147,7 +146,7 @@ Example.events = function() { Events.on(mouseConstraint, 'mousedown', function(event) { var mousePosition = event.mouse.position; console.log('mousedown at ' + mousePosition.x + ' ' + mousePosition.y); - shakeScene(engine, event.delta); + shakeScene(engine); }); // an example of using mouse events on a mouse diff --git a/src/body/Body.js b/src/body/Body.js index 33f8855..9e991df 100644 --- a/src/body/Body.js +++ b/src/body/Body.js @@ -400,7 +400,7 @@ var Axes = require('../geometry/Axes'); * Note that this method will ensure that the first part in `body.parts` will always be the `body`. * @method setParts * @param {body} body - * @param [body] parts + * @param {body[]} parts * @param {bool} [autoHull=true] */ Body.setParts = function(body, parts, autoHull) {