Skip to content

Commit

Permalink
kinematic-body: check contact equation is enabled before applying
Browse files Browse the repository at this point in the history
  • Loading branch information
wmurphyrd authored and donmccurdy committed Oct 27, 2017
1 parent 59b0d88 commit f0a94bc
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/misc/kinematic-body.js
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,9 @@ module.exports = {

for (var i = 0, contact; (contact = this.system.world.contacts[i]); i++) {
// 1. Find any collisions involving this element. Get the contact
// normal, and make sure it's oriented _out_ of the other object.
// normal, and make sure it's oriented _out_ of the other object and
// enabled (body.collisionReponse is true for both bodies)
if (!contact.enabled) { continue; }
if (body.id === contact.bi.id) {
contact.ni.negate(currentSurfaceNormal);
} else if (body.id === contact.bj.id) {
Expand Down

0 comments on commit f0a94bc

Please sign in to comment.