Search Issue Tracker
By Design
Votes
7
Found in
2019.4
2020.3
2020.3.24f1
2021.2
2022.1
2022.2
Issue ID
1403474
Regression
No
Inconsistent ContactPoint placement when using OnCollisionEnter
1. Open project "PhysicsBugs.zip"
2. Enter Play Mode
3. Press the spacebar and observe the view
Expected result: Contact points are in the same position every time
Actual result: Contact points are in the different positions
Reproducible with: 2019.4.36f1, 2020.3.30f1, 2021.2.14f1, 2022.1.0b10, 2022.2.0a6
Note: Reproducible in the Editor and in the Player
Add comment
All about bugs
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
Latest issues
- Localization Group Rules bypasses Locale logic when SharedGroup asset provided
- UI Toolkit World UI Text Field unfocuses immediately when clicking on it using XR Controller
- Crash on CallWindowProcW when entering Play mode for the second time and running the Editor in the background while using System.Windows.Forms functions
- 2D Freeform Light shadows disappear when light center is offset from shape bounds
- Crash on MarkAllDependencies when opening scenes with Assets from the YarnSpinner package
Resolution Note:
This behaviour is internal to the physics engine. Basically, there is a table of functions that generate pairs for shapes of given types: sphere vs box, box vs capsule, etc. This table is not symmetric: if it has an entry for table[x][y], it won't have an entry for table[y][x]. Because of that, when computing the contact points, the physics engine sorts shape types in a pair according to the value in the appropriate enum. Then, this new shape pair is used to fetch the matching contact computation function from the table, so that is what I believe will make it relate to one or the other shape.
Reference:
[1] PxGeometry enum values: (https://github.com/NVIDIAGameWorks/PhysX/blob/c3d5537bdebd6f5cd82fcaf87474b838fe6fd5fa/physx/include/geometry/PxGeometry.h#L53)
[2] Check if a swap is required: https://github.com/NVIDIAGameWorks/PhysX/blob/c3d5537bdebd6f5cd82fcaf87474b838fe6fd5fa/physx/source/lowlevel/common/src/pipeline/PxcNpBatch.cpp#L325
[3] Pick the contact generation function: https://github.com/NVIDIAGameWorks/PhysX/blob/c3d5537bdebd6f5cd82fcaf87474b838fe6fd5fa/physx/source/lowlevel/common/src/pipeline/PxcNpBatch.cpp#L381