collision object ordering and collision results #3535
Replies: 6 comments
-
Yes, the order of operations is one of several parts that can influence the outcome of the collision detection computation. This is a complex topic and it helps to first determine:
It helps to use the double precision version of Bullet if you care about collision quality, are you using double or single precision? Once we have all the details of above, we likely can sort out the order-dependent results. Ideally we just create a simple reproduction case in the Bullet Example Browser and go from there, it is pretty trivial to create it. |
Beta Was this translation helpful? Give feedback.
-
Two answer your questions:
A cylinder and a convex hull shape
This particular query is for colliding objects, so I assume EPA. (ultimately invoked by a call to
Technically, yes, but the result I'm looking at is the very first invocation of the collision detection, so persistence shouldn't be an issue.
This is possible but highly unlikely. I haven't delved specifically into the exact scenario but the odds that the contact is on the cap of the cylinder that is perfectly aligned with the colliding face is so small, I assume not.
Yes, double. I can look into creating a reproduction if we feel that's the best way forward. |
Beta Was this translation helpful? Give feedback.
-
Are you using default collision margins? If not, this can introduce all kinds of issues. |
Beta Was this translation helpful? Give feedback.
-
It's difficult for me to accurately assess if we're using "default" margins. We have different behavior based on the the type of shape.
The query we're doing (where the answer depends on ordering) is using the geometry described above with the minimum margin value of 1e-9. |
Beta Was this translation helpful? Give feedback.
-
If you provide a reproduction case in a simple Bullet demo, I'll look if we can improve it. Once you start setting the margin to tiny values (such as 1e-9) you are fighting the implementation. 1e-9 margins for various objects will disable robustness and reduce performance in GJK/EPA: it relies on some positive margin to avoid degenerate GJK simplex and to avoid EPA in shallow penetration cases. In many cases it is possible to use a larger margin and embed the margin inside the object: |
Beta Was this translation helpful? Give feedback.
-
I'll work up an example and get back to you. |
Beta Was this translation helpful? Give feedback.
-
I have a scenario with two colliding objects. I find that if I add them to the collision world in one order I get a slightly different collision computation than if I add them in the reverse order. The location of the contact point varies on an order of approximately 1e-5.
Is this a known property? How dependent is accuracy on order of operations and, if it depends, is there a prescribed order that will reduce inaccuracies?
Beta Was this translation helpful? Give feedback.
All reactions