-
-
Notifications
You must be signed in to change notification settings - Fork 225
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Capsule vs Capsule Collision Make sure the penetration depth is not zero #382
Capsule vs Capsule Collision Make sure the penetration depth is not zero #382
Conversation
Is the sqrt() really needed? Why not compare the difference of closestPointsDistanceSquare and sumRadiusSquare with an epsilon instead? |
I tried with with different values for eps:
but after few seconds of simulation I always get |
After reading a second time, what about something like
|
It works well, I tried it for a few minutes without errors. |
Reverted the previous change and pushed the fix on this branch. |
Thanks a lot for your pull request. |
Just tried it for a few minutes: it works. Thank you. |
Thanks a lot for your feedback. That's very helpful. |
Sometimes assertion fails in NarrowPhaseInfoBatch::addContactPoint():
assert(penDepth > decimal(0.0));
This happens for Capsule/Capsule collision check.
Probable cause is float approssimation in
bool CapsuleVsCapsuleAlgorithm::testCollision(NarrowPhaseInfoBatch& narrowPhaseInfoBatch, uint32 batchStartIndex, uint32 batchNbItems, MemoryAllocator& /*memoryAllocator*/) ;
I inserted a double check on penetrationDepth.
if (penetrationDepth > 0)
The logic is the same of SphereVsSphereAlgorithm::testCollision().