mirror of
https://github.com/love2d/love.git
synced 2026-08-16 00:02:12 +02:00
Added Contact:getFixtures and Body:getContactList (see issue #905).
The list of Contacts associated with bodies changes during World:update (potentially multiple times), so you might miss collisions if you don't use the World callbacks at all.
This commit is contained in:
@@ -142,6 +142,15 @@ void Contact::getChildren(int &childA, int &childB)
|
||||
childB = contact->GetChildIndexB();
|
||||
}
|
||||
|
||||
void Contact::getFixtures(Fixture *&fixtureA, Fixture *&fixtureB)
|
||||
{
|
||||
fixtureA = (Fixture *) Memoizer::find(contact->GetFixtureA());
|
||||
fixtureB = (Fixture *) Memoizer::find(contact->GetFixtureB());
|
||||
|
||||
if (!fixtureA || !fixtureB)
|
||||
throw love::Exception("A fixture has escaped Memoizer!");
|
||||
}
|
||||
|
||||
} // box2d
|
||||
} // physics
|
||||
} // love
|
||||
|
||||
Reference in New Issue
Block a user