hecht-software / box2dweb

Automatically exported from code.google.com/p/box2dweb
308 stars 94 forks source link

b2Contact lists not updated when setting filterdata #53

Open ErikSom opened 6 years ago

ErikSom commented 6 years ago

The error is obvious in SetFilterData:

b2Fixture.prototype.SetFilterData = function (filter) { this.m_filter = filter.Copy(); if (this.m_body) return; var edge = this.m_body.GetContactList(); while (edge) { var contact = edge.contact; var fixtureA = contact.GetFixtureA(); var fixtureB = contact.GetFixtureB(); if (fixtureA == this || fixtureB == this) contact.FlagForFiltering(); edge = edge.next; } }

You see "if(this.m_body) return" should be "if(!this.m_body) return".