Skip to content
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

Contact generated despite absolute seperation value higher than contact offset #156

Closed
alektron opened this issue Jun 29, 2023 · 2 comments
Assignees

Comments

@alektron
Copy link

alektron commented Jun 29, 2023

Library and Version

release/104.2

Operating System

Windows 10

Description

For Capsule-Mesh contact generation, contacts can be generated whose seperation value is higher than the contact offset.
In some scenarios (image below) with relatively thin objects this can lead to contacts being generated on the opposite side of the colliding objects.

image
(Note that the image is from the old PhysX 4.1 PVD, since that is where the bug was initially discovered. The same code however is used in PhysX 4.1 and 5.0)

Proposed fix

See pull request #157
The contacOffset check compares against the t/distance value of intersectRayTriangle.
This value can however be negative, so the comparison t < radius + contactDistance can be true despite the absolute value of t being higher than radius + contactDistance

@vreutskyy
Copy link
Collaborator

Hello, alektron
The negative distance is considered a contact despite of it's magnitude. Like if you'd push this capsule inside a plane or a solid box. No matter how deep it would be, it'd be still a contact. So, it's not a bug, but still, thank you for the report.

@alektron
Copy link
Author

alektron commented Jul 6, 2023

That does make sense.
However I'd argue that the generated contact is still caused by some bug, even if my guess at the cause wasn't correct.
The behaviour of the dynamic rigid body in the scene (the capsule) was very much unusable before my 'fix' due to these contacts.
With the capsule jumping around and eventually getting shot away when touching the inside of the 'chain' visible in the above image. Sometimes it even happens when just moving inside the 'chain' hole without touching anything.

As previously stated I encountered the bug with PhysX 4.1.
Since the code, that I assumed was the problem, is present in 4.1 AND 5.0 I figured it'd make more sense to post it here.
I will try to update my project to PhysX 5 and see if the problem still persists and if it does I can try to create a minimal example.

EDIT: It does indeed still happen with 5.2 (see attached PVD file, glad to see 5.X still supports it)
ContactGen.zip

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants