Search code examples
androidgame-physicsandenginephysics-enginelibgdx

creating a smooth rope with an android physics engine


I want to practice programming with (popular) android physics engines (AndEngine and libgdx).

It is not very difficult to create a small world with physics objects but now I want to create a rope and connect it to objects in the world.

There are several ways to do it, for example:
http://www.emanueleferonato.com/2009/10/05/basic-box2d-rope/

But I want to see a smooth rope like in "Cut The Rope" game on Android and IOS.

Are there any ideas how to do this? I can't find answer yet but I think it would be to create a number of smaller objects tied together but I think this would be bad performance-wise?


Solution

  • I believe your instinct to create shorter segments with joints connecting them is correct and yes, the number of bodies you end up creating for a length of rope will have an effect on the performance.

    To know whether it will work for your particular situation, I would suggest creating a rope with variable length segments and make a decision based off benchmarking the performance as to how smooth you can make the rope by increasing the number of segments.