Dynamic body having multiple fixtures stuck on static body

Discuss issues specific the Java port of Box2D
mbue
Posts: 2
Joined: Sat Jun 28, 2014 12:24 am

Dynamic body having multiple fixtures stuck on static body

Postby mbue » Sat Jun 28, 2014 12:42 am

Hello,

currently I'm implementing a platformer using Box2D. I know Box2D isn't regarded as the best choice here, but the game has some physical effects I could hardly realize without a physics engine.
The game works pretty well so far, however one Problem I never could really solve: How to prevent a body having multiple fixtures getting stuck at static bodies?

The picture here explains the problem : http://postimg.org/image/ary4ln4m1/
The player consists of a large rectangle (friction=0) and a circle (friction=1). With this setup I can prevent the player getting slowed down when touching a wall while falling. The circle below is the result of testing different fixture setups for the player, and with that one I could minimize the number of time I've been stuck at static edges.

I already have an algorithm merging tiles into larger static bodies. So inbetween tiles I never have problems. The problem occurs only at edges as shown in the picture. The circle fixture and the rectangle fixture have the same width, but sometimes the situation shown in the picture still occurs.

So generally I'd wanted to ask:
What is the best fixture setup for a typical platformer character?
Are there any common tricks in detecting and solving such situations?

Thank you in advance...

irresistible force
Posts: 1991
Joined: Tue Jun 24, 2008 8:25 pm
Location: Tokyo
Contact:

Re: Dynamic body having multiple fixtures stuck on static bo

Postby irresistible force » Sat Jun 28, 2014 5:54 am

You mean this is getting stuck when sliding down the wall right? Does it help if you make the circle a little larger?

mbue
Posts: 2
Joined: Sat Jun 28, 2014 12:24 am

Re: Dynamic body having multiple fixtures stuck on static bo

Postby mbue » Sat Jun 28, 2014 6:33 am

Thank you for your reply.
I tried to make its radius 1px larger and the problem still occured.
If I make the radius even larger, the circle starts to slow down the player when touching a wall while falling.


Return to “Java”



Who is online

Users browsing this forum: No registered users and 1 guest