Create a smooth rope with the Android physics engine

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

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

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

But I want to see the rope smooth , as in the game "Cut The Rope" on Android and IOS.

Any ideas how to do this? I can’t find the answer yet, but I think that it would be possible to create several smaller objects connected with each other, but I think that would be a bad result?

+4
source share
2 answers

I believe that your instinct for creating shorter segments with the joints connected to them is correct and yes, the number of bodies that you ultimately create for the length of the rope will affect performance.

To find out if this will work for your specific situation, I would suggest creating a rope with variable length segments and make a decision based on a comparative analysis of performance regarding how smoothly you can make a rope by increasing the number of segments.

+4
source

On ios, we based our rope in this example http://www.cocos2d-iphone.org/archives/1112 , now we are trying to port it to Android, but our version of box2d does not yet support a rope connection.

0
source

Source: https://habr.com/ru/post/1342426/


All Articles