box2dweb icon indicating copy to clipboard operation
box2dweb copied to clipboard

b2Contact lists not updated when setting filterdata

Open ErikSom opened this issue 8 years ago • 0 comments

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".

ErikSom avatar Sep 08 '17 07:09 ErikSom