box2dweb
box2dweb copied to clipboard
b2Contact lists not updated when setting filterdata
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".