Skip to content

Commit

Permalink
don't calculate gravity force if there is no actual gravity
Browse files Browse the repository at this point in the history
  • Loading branch information
danielkcz committed Jul 3, 2015
1 parent 5b2b060 commit e54802c
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/core/Engine.js
Original file line number Diff line number Diff line change
Expand Up @@ -286,6 +286,9 @@ var Engine = {};
* @param {vector} gravity
*/
var _bodiesApplyGravity = function(bodies, gravity) {
if (gravity.x === 0 && gravity.y === 0) {
return;
}
for (var i = 0; i < bodies.length; i++) {
var body = bodies[i];

Expand Down

0 comments on commit e54802c

Please sign in to comment.