Open bonsairobo opened 4 years ago
Hi! Your example terminates after one iteration with the latest version of ncollide (0.20.1). Can you try again after updating your ncollide3d dependency?
That helps, thanks! I can't remember why I took a specific dependency on 0.19, but now I can upgrade.
So the new version doesn't get stuck, but it does give me an assertion at
ncollide3d-0.20.1/src/query/algorithms/epa3.rs:143
for my actual use-case (not the simple 2 cube repro).
I'll make a new issue for that.
I have a short repro:
Basically, I'm trying to use a
CollisionWorld
to push apart a bunch of colliding cuboids. I've simplified the example here to just 2 cubes. You'll see that withncollide3d = "0.19"
, the example will loop forever because it never realizes that the cubes are not in contact after being pushed apart.This must be a regression in behavior according to the documentation of an older version (0.14.1).
It states that
contact_pairs
"iterates through all the contact pairs detected since the last update." So you can see the problem is that it also iterates through pairs detected before the last update.I think maybe I can work around this using the
contact_events
function, but it makes things more complicated because of my particular application. I don't want to push the objects more than necessary, so, for each iteration over the contacts, I will only push an object the first time I see it in a contact pair. By pushing an object, it might resolve more collisions that come up in the contact iterator later, and I don't want to try resolving these unnecessarily. If I have to usecontact_events
, then when I ignore a "stale" contact, I may never see the contact pair again if the collision is left unresolved. At least this is my interpretation of the docs here. Specifically, this part aboutContactEvent::Started
: "This event is generated whenever the narrow-phase finds a contact between two collision objects that did not have any contact at the last update."It would be greatly appreciated if someone could suggest another workaround while this bug is addressed. Thanks!