Jolt crashing on JPH_ASSERT #887
-
|
I am not sure what exactly this assert means or what ioV is. https://www.youtube.com/watch?v=KvisjT9RN98 If needed, I can try to put together a demo that can be run from the Jolt samples project, but it will take some time to put it together. |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 13 replies
-
|
My guess is that there is a degenerate triangle in the mesh that you're driving/walking over at that moment. Can you try calling MeshShapeSettings::Sanitize on the mesh before you create the shape? (both constructors do this internally, but if you fill in mTriangleVertices/mIndexedTriangles later then it won't be called automatically). |
Beta Was this translation helpful? Give feedback.
-
|
I did a little experiment with your sample code in https://pastebin.com/1JSTavcs, if I change Looking at the callstack, there are only 2 ways why triangle can be degenerate:
So it removes 5 degenerate triangles, and that ensures that the issue doesn't happen in the Samples app. Maybe you can check that in your application it removes the same amount?
inV0, inV1 and inV2 are the vertices of the triangle as it was stored in the mesh shape. If these form a degenerate triangle then it is possible that the vertex quantization (done for mesh compression) snapped two vertices together while they were not together in the original input data. Otherwise either mTransform2To1 or mScale must cause the triangle v0, v1, v2 to become degenerate. Maybe you can check which of the two it is? |
Beta Was this translation helpful? Give feedback.
-
|
I think I have a potential fix for your issue. Can you try out #891? I haven't tested this on your repo, but I think the difference between your project and the sample project is that you didn't export your mesh with enough precision (you need to use at least 6 digits behind the dot to be certain that there is no loss during export). If I fudge the vertices a bit then I can reproduce the crash, and with this change I can't anymore. |
Beta Was this translation helpful? Give feedback.
-
|
Oh and to answer your other question:
If you mean a monetary donation, then no, I'm not accepting those at the moment. |
Beta Was this translation helpful? Give feedback.


I think I have a potential fix for your issue.
Can you try out #891?
I haven't tested this on your repo, but I think the difference between your project and the sample project is that you didn't export your mesh with enough precision (you need to use at least 6 digits behind the dot to be certain that there is no loss during export). If I fudge the vertices a bit then I can reproduce the crash, and with this change I can't anymore.