Meet a non-deterministic problem when two colliable kinematic rigid bodies come into intersection #1167
Replies: 1 comment
-
It only makes sense for kinematic objects to intersect with each other if there's some game mechanic that you want to trigger. The physics simulation does nothing with collisions between kinematic objects. I assume you have set I'm assuming you've defined JPH_CROSS_PLATFORM_DETERMINISTIC? What CPUs/OS-es did these machines have? There are too many unknown variables at this point for me to investigate. Can you please create a minimal reproduction case? A popular approach is to hack |
Beta Was this translation helpful? Give feedback.
-
As shown in the figure, I have two kinematic rigid bodies, A and B, moving in the same direction, where B is moving faster than A. They are on the same object layer, but I mistakenly set this layer to be able to collide with itself.
I ran this demo on two machines simultaneously. At the beginning, the results of each frame on both machines were completely identical. After a while, when B caught up with A, B and A intersected. At this point, the results calculated by the two machines were no longer the same. And after a while, when B completely overtook A, the calculation results returned to being consistent.
I extracted a BodyPair segment from a Contact, as follows:
machine A:
mContactNormal = 1.22139943e-06, -5.34267519e-06, 1.00000000
mPosition2 = -0.00106811523, -1.10757065, -2.31998825
machine B:
mContactNormal = 1.22139943e-06, -5.34267519e-06, -1.00000000
mPosition2 = -0.00106811523, -1.10757065, 2.31998825
The z-values of mContactNormal and mPosition2 are opposite on the two machines.
I suspect that when two kinematic objects intersect, the collision calculation may produce indeterminate results. Should kinematic rigid bodies be prevented from intersecting?
Thanks.
Beta Was this translation helpful? Give feedback.
All reactions