Closed 607011 closed 9 years ago
Hint for solution:
The OneSidedPlatform
test in the Box2D testbed uses the PreSolve()
contact listener to reset the collision bit of a body by calling contact->SetEnabled(false)
:
void PreSolve(b2Contact* contact, const b2Manifold* oldManifold)
{
b2Fixture* fixtureA = contact->GetFixtureA();
b2Fixture* fixtureB = contact->GetFixtureB();
if (fixtureA != m_platform && fixtureA != m_character)
return;
if (fixtureB != m_platform && fixtureB != m_character)
return;
b2Vec2 position = m_character->GetBody()->GetPosition();
if (position.y < m_top + m_radius - 3.0f * b2_linearSlop) {
contact->SetEnabled(false);
}
}
Resolved with commit dd61e49f76133b1b433b04b2c7eb0340a99153eb
See issue #7