1

I have a rope with pin joints between chain rings. It had worked perfectly.

I now want to simulate real chain, so I added limits for pin joints as such:

pinJoint.upperAngleLimit = CGFloat(M_PI / 6) 
pinJoint.lowerAngleLimit = CGFloat(-M_PI / 6)
pinJoint.shouldEnableLimits = true

However, when I use a ball-like start of the chain, I get pictures 3-4 (shown below)

I tried to use constraints, but they weren't really helpful

CodeSmile
  • 64,284
  • 20
  • 132
  • 217
Simankov
  • 91
  • 11

1 Answers1

0

Have you tried to use Matti's rope module? This worked pretty well for me. The simulation became very unstable based on the mass of the ball. Try reducing the mass of the rope links and the ball. Also, if the rope spins too fast the physics will also become unstable.

I think next time I will try using Verlet integration like this example. This also has the advantage of being able to attach on both ends.

Patrick Collins
  • 4,046
  • 3
  • 26
  • 29