0
0
Fork 0
mirror of https://github.com/liabru/matter-js.git synced 2024-11-27 09:50:52 -05:00

Merge branch 'no-gravity-optim' of https://github.com/BlackDice/matter-js into BlackDice-no-gravity-optim

This commit is contained in:
liabru 2015-12-23 16:04:16 +00:00
commit 1b8574ac16

View file

@ -281,6 +281,9 @@ var Body = require('../body/Body');
* @param {vector} gravity * @param {vector} gravity
*/ */
var _bodiesApplyGravity = function(bodies, gravity) { var _bodiesApplyGravity = function(bodies, gravity) {
if (gravity.x === 0 && gravity.y === 0) {
return;
}
for (var i = 0; i < bodies.length; i++) { for (var i = 0; i < bodies.length; i++) {
var body = bodies[i]; var body = bodies[i];