box2d icon indicating copy to clipboard operation
box2d copied to clipboard

Crash with prismatic joint

Open max7im-prog opened this issue 3 months ago • 3 comments

I started experiencing crashes with prismatic joint. The crash happens when I create very unstable assemblies that begin to oscillate uncontrollably.

I've created a sample in samples app in this repository: https://github.com/max7im-prog/game-box2d/tree/prismatic-crash

To reproduce:

  • run samples app
  • go to samples->issues->Crash with prismatic joint
  • the assembly is very unstable so the application is supposed to crash after that

max7im-prog avatar Sep 18 '25 11:09 max7im-prog

This is the setup. There is a central rectangle connected to a small circle in the center using a weld joint. Then the two large circles on the sides are connected to the small circle using prismatic joints.

Image

erincatto avatar Sep 26 '25 16:09 erincatto

I removed the rectangle and weld joint and it is still unstable. The prismatic joints have stiff springs (10Hz) that contribute to the instability.

Image

erincatto avatar Sep 26 '25 22:09 erincatto

I investigated this some more. I don't think the solver can handle this setup. It is easy to modify the setup to make it stable, such as making the central circle bigger.

I'll keep this open in case I try some different solver strategies in the future.

erincatto avatar Oct 19 '25 17:10 erincatto