changed behavior: chain of small bodies unstable when wrapped around a rotating kinematic #2041
Replies: 10 comments 1 reply
|
I don't immediately see which change could have caused this (#1970 seems unlikely, although it would be possible). Can you maybe answer the following questions?
|
|
The OS is Linux Mint v22.3 . The compiler is Clang++ 14. Here's the full configuration string: Single precision x86 64-bit with instructions: SSE2 SSE4.1 SSE4.2 AVX AVX2 F16C LZCNT TZCNT FMADD (16-bit ObjectLayer) (ObjectStream)Defines include Other compiler options include Here's a zipped snapshot generated with |
|
I re-tested using a Debug build and got identical results. |
|
I compiled the library with Jolt.Physics.Samples.Ubuntu-24.04.2026-06-05.14-16-47.mp4I tried various other configurations and things like varying update frequencies, different gravity settings and different barrel rotation directions/speeds, but I could not get it to explode. The only thing that happens (on all versions when the rotation speed of the barrel is high enough) is that sometimes the tension becomes high enough for a link to tunnel through another, but that doesn't cause instabilities. Is there anything else I need to do to get the same conditions as you? (e.g. what update frequency / barrel rotation speed are you using?) |
|
Maybe you can post a video as well? |
|
A video might help clarify things. I'll work on that. |
|
My rotation rate is 4 radians/second around the X axis. I see issues both with +X and -X rotations. |
|
Here's a video clip of the old/expected behavior: Here are 3 video clips of the new/undesirable behavior: |
No, global settings are not stored in the snapshot. Only bodies and their constraints.
Those movies provide the final piece of the puzzle: You can see that the barrel is rotating in the first movie, but isn't in the other 3 movies. What this tells me:
If you immediately start rotating the barrel, it hasn't gone to sleep yet, so it will be active and it will work as before. So TLDR: You need to ensure that you activate the body when you set a velocity on it. The best way is to use I will add an assert that detects this situation / add some additional notes to the documentation. Unfortunately I cannot do this in |
|
Thanks for solving the mystery! |
Uh oh!
There was an error while loading. Please reload this page.
I recently discovered an unexpected and undesirable change in behavior of JoltPhysics that occurred between 26 March and 20 April of this year (2026). I guess the change might be related to PR #1970.
My test case is written in Java, and it simulates a windlass. The barrel of the windlass is a kinematic rigid body with a compound shape. User input causes the barrel to rotate around a horizontal axis. The barrel is attached to one end of a long cable, simulated as a chain of 53 "segments" (small dynamic rigid bodies) joined by point constraints. Initially 90% of the cable is coiled around the barrel of the windlass:
When simulated using JoltPhysics as of 26 March, rotating the barrel causes the cable to smoothly coil or uncoil. When simulated using JoltPhysics as of 20 April, rotating the barrel causes the cable to briefly intersect with the barrel, become unstable, whip around, and partially explode:
The failure is actually more subtle than I've described it. If I allow the physics simulation to settle for 5 seconds before rotating the barrel, I get the explosion. If I start rotating the barrel soon after the simulation starts, there's no explosion.
Any theory why changes made in March-April might've led to instability? Does my guess that it's related to PR #1970 seem plausible? Any ideas how I could determine the cause of the instability or work around it?
All reactions