Closed Sushisource closed 6 years ago
Note that world.contact_pairs()
returns an iterator on all the pairs detected by the broad phase, i.e., the pairs with intersecting bounding volumes. To check if there is actually a contact you have to call the num_contacts
method, i.e. your test should be world.contact_pairs().next().2.num_contacts() == 0
.
Wow, thanks! That helps a lot. The ContactPairs in general are a little hard to grok - the documentation is pretty minimal there.
I'd be happy to add some docs / maybe the debug derives if that's a contribution that sounds worthwhile.
Thanks!
Of course, any contribution on the documentation is very welcome! Debug derives would be useful as well. I'd prefer that no trait inherit from Debug
though.
In my app I've got "rooms" represented as a compound shape composed of four (or more) walls. I have created an example that illustrates the bug below. The second "room" fits completely within the first, and a contact query indeed returns no contacts. However, the collision world erroneously thinks they are in contact.
Side note: Contact pairs are not debug printable which would be really nice to have
Thanks for your work on the library! Happy to help out if desired.